wavedash 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/test.yaml +24 -0
- data/README.md +11 -12
- data/lib/wavedash/version.rb +1 -1
- data/wavedash.gemspec +2 -2
- metadata +12 -13
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 63c1b27753cc9fbd9a1e820d257c8c92c8b6cb7ed0a4162eeb505e7ad9fa8e68
|
|
4
|
+
data.tar.gz: 96c3a67e33c4e6c1affa5f3214431a90ff8bbe847dc42ee66087b72cdda95fc2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7bc573d5d2c26a6d3d1080b5c868b524a569875ba4a7786b6830b302fdbb327670cd74e7177951a14f8803e7a91e52b04c324d898aaa2b43bd28fc0d4d932ab2
|
|
7
|
+
data.tar.gz: f8144c469c2d79258400130b647c68573674259569204c4452a0888991140a6f6c456fe8a45a78d3708c2e45f37316a90db7878d996f92f3e92daff3b33a06af
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [master]
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [master]
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
ruby-version: [2.6, 2.7, "3.0"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v2
|
|
16
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
17
|
+
uses: ruby/setup-ruby@v1
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
20
|
+
bundler-cache: true
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: bundle install
|
|
23
|
+
- name: Run tests
|
|
24
|
+
run: bundle exec rake
|
data/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# Wavedash
|
|
1
|
+
# Wavedash 
|
|
2
2
|
|
|
3
3
|
Normalize unencodable characters that raise `Encoding::UndefinedConversionError` exception in `String#encode`.
|
|
4
4
|
|
|
5
5
|
### Support encoding
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
- eucjp-ms
|
|
8
|
+
- euc-jp
|
|
9
|
+
- cp932
|
|
10
|
+
- shift_jis
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -62,8 +62,8 @@ Wavedash.invalid?(str) # => true
|
|
|
62
62
|
|
|
63
63
|
Character code conversion is required when interact between softwares that treet different character code. For example, it is a situation such as the following.
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
- A Web application written in UTF-8 using a database saved in EUC-JP
|
|
66
|
+
- Exchanging data files(csv,tsv,..) between different systems
|
|
67
67
|
|
|
68
68
|
In Ruby, You can convert a character code using `String#encode`, but some characters cannot. `Encoding::UndefinedConversionError` raises when a character is undefined in the destination encoding. But `String#encode` has options. You can specify `:undef => :replace` then replace the undefined characters with the replacement character.
|
|
69
69
|
|
|
@@ -71,10 +71,10 @@ In Ruby, You can convert a character code using `String#encode`, but some charac
|
|
|
71
71
|
|
|
72
72
|
Despite some characters have resembling shape, character code point is different each other. For example, when you convert characters to EUCJP-MS from UTF-8, can convert "~" (FULLWIDTH TILDE U+FF5E) but cannot convert "〜" (WAVE DASH U+301C). The opposite will occur when you convert to EUC-JP.
|
|
73
73
|
|
|
74
|
-
UNICODE
|
|
75
|
-
|
|
76
|
-
"〜" U+301C WAVE-DASH
|
|
77
|
-
"~" U+FF5E FULLWIDTH TILDE | Encoding::UndefinedConversionError | 0xA1C1
|
|
74
|
+
| UNICODE | EUC-JP | EUCJP-MS |
|
|
75
|
+
| --------------------------- | ---------------------------------- | ---------------------------------- |
|
|
76
|
+
| "〜" U+301C WAVE-DASH | 0xA1C1 | Encoding::UndefinedConversionError |
|
|
77
|
+
| "~" U+FF5E FULLWIDTH TILDE | Encoding::UndefinedConversionError | 0xA1C1 |
|
|
78
78
|
|
|
79
79
|
In Web applications, it depends on the client environment that the input character as "〜" is U+301C or U+FF5E. This cannot select by the application. What you can do with the application is only to determine the handling of the unencodable characters.
|
|
80
80
|
|
|
@@ -97,4 +97,3 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
97
97
|
## License
|
|
98
98
|
|
|
99
99
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
100
|
-
|
data/lib/wavedash/version.rb
CHANGED
data/wavedash.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
19
|
spec.require_paths = ["lib"]
|
|
20
20
|
|
|
21
|
-
spec.add_development_dependency "bundler"
|
|
22
|
-
spec.add_development_dependency "rake"
|
|
21
|
+
spec.add_development_dependency "bundler"
|
|
22
|
+
spec.add_development_dependency "rake"
|
|
23
23
|
spec.add_development_dependency "rspec"
|
|
24
24
|
end
|
metadata
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wavedash
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Takatoshi Ono
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-10-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '0'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rspec
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -59,9 +59,9 @@ executables: []
|
|
|
59
59
|
extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
|
61
61
|
files:
|
|
62
|
+
- ".github/workflows/test.yaml"
|
|
62
63
|
- ".gitignore"
|
|
63
64
|
- ".rspec"
|
|
64
|
-
- ".travis.yml"
|
|
65
65
|
- CODE_OF_CONDUCT.md
|
|
66
66
|
- Gemfile
|
|
67
67
|
- LICENSE.txt
|
|
@@ -91,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
91
91
|
- !ruby/object:Gem::Version
|
|
92
92
|
version: '0'
|
|
93
93
|
requirements: []
|
|
94
|
-
|
|
95
|
-
rubygems_version: 2.5.1
|
|
94
|
+
rubygems_version: 3.2.29
|
|
96
95
|
signing_key:
|
|
97
96
|
specification_version: 4
|
|
98
97
|
summary: Normalize unencodable characters
|