chinese_pinyin 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc080c9b7f03c06943898bd0bb415b288179ff64
4
- data.tar.gz: 8545806d8f991c6aa1831298e0f665a3e926e658
3
+ metadata.gz: ebb9e7b3731b3149a52eef70e0c81730903628cf
4
+ data.tar.gz: 4d78cbe68ffabbf97de7f3755be7cf4017ea945c
5
5
  SHA512:
6
- metadata.gz: 9d679f93ddfc49e788cb8ec183c8cb394750a2159f0fad93c56f0a689217d4cc74a76e0603eed24c4330055030a7aa3a309bcf1832b30dec30ce934ff64f507c
7
- data.tar.gz: 1add5ee967db25b07a2e742c2cf64220f31e151e096b5a15ba0f256bc6e41d39d0b48908171e2c6c97bd916474b451b9ffe2fba9002b475d889ad91c3edc3ca0
6
+ metadata.gz: 4da5ebcbd2cfaea171ccfc0868788c69eabd27e16b7459e0a9b75981d5b89adf0747f930b8528541ed6b41493f9942b7629590f437e8df2a4a7611e8dec5d54c
7
+ data.tar.gz: 60ada2ec4e9503f35f705759f1b8cf3f49d3103768e6e158f05bae7ad0225e1f915694628743b4c69556cf2d02d4d911960264fc265de1c5adc01e96636dcbe0
@@ -1,3 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2
3
+ - 2.3.0
@@ -1,5 +1,9 @@
1
1
  # Next Release
2
2
 
3
+ ## 1.0.1
4
+
5
+ * force utf8
6
+
3
7
  ## 1.0.0 (06/23/2015)
4
8
 
5
9
  * add executable cmd ch2py
data/README.md CHANGED
@@ -14,7 +14,7 @@ gem install chinese_pinyin
14
14
 
15
15
  or add in Gemfile.
16
16
 
17
- ```ruby
17
+ ```
18
18
  gem 'chinese_pinyin'
19
19
  ```
20
20
 
@@ -26,7 +26,7 @@ class Pinyin
26
26
  datfile = @ruby2 ? 'pinyin-utf8.dat' : 'Mandarin.dat'
27
27
  @table = {}
28
28
 
29
- File.open(File.dirname(__FILE__) + "/../data/#{datfile}") do |file|
29
+ File.open(File.dirname(__FILE__) + "/../data/#{datfile}", "r:UTF-8",) do |file|
30
30
  while line = file.gets
31
31
  key, value = line.split(' ', 2)
32
32
  @table[key] = value
@@ -50,6 +50,7 @@ class Pinyin
50
50
  end
51
51
 
52
52
  def translate(chars, options={})
53
+ chars = chars.force_encoding("UTF-8")
53
54
  splitter = options.fetch(:splitter, ' ')
54
55
  tonemarks = options.fetch(:tonemarks, false)
55
56
  tone = options.fetch(:tone, false || tonemarks)
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module ChinesePinyin
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chinese_pinyin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-22 00:00:00.000000000 Z
12
+ date: 2016-07-06 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: translate chinese hanzi to pinyin.
15
15
  email:
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  version: 1.3.6
57
57
  requirements: []
58
58
  rubyforge_project:
59
- rubygems_version: 2.4.7
59
+ rubygems_version: 2.5.1
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: translate chinese hanzi to pinyin.