rchardet 1.6.1 → 1.7.0

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: 8ac135771ad7fdcd19002eecbcc41ff1dbc561a1
4
- data.tar.gz: 4fe1aae4676d0b89095cc8132f500be8f04cf65f
3
+ metadata.gz: 3cdc02a9943abeba846fd618a5ee9f04fe8ef506
4
+ data.tar.gz: edeeefd5700589aa5bb8cbc371a6cd580e2557fc
5
5
  SHA512:
6
- metadata.gz: c3346de92a1674175a08c7bc4098c8ad7e703ad352535015ea22dcaf50a4198d310d7889990411a7e9353f3e8f400342d40264c5e3d5ab91d41b5607e5b7870b
7
- data.tar.gz: 7b89ed96df682956a90b8c7ffd72573dcd1fde4c03fb2196bbd808a34dd98124fac940dbe7216c1169908b0a306747c84cf51caa29bc6aaef85369751cdede0f
6
+ metadata.gz: facabfeae468c114f98ae3e6f38aedbf9c3a1f4393995b00d539903b67444a1124ed2a1307c56192263d6b28a9167766fd2fdd1c5eda2183379d37a679cb5a10
7
+ data.tar.gz: 374d62ffda808bfd64639de216087162d2f117fd78cbc87fc9bcd05162e00c0e311638a20748c8a7033b7ad5320ff2ab8d2011843e4400992c23548911fabc49
@@ -90,6 +90,16 @@ module CharDet
90
90
  elsif aBuf[0, 2] == "\xFE\xFF"
91
91
  # FE FF UTF-16, big endian BOM
92
92
  @result = {'encoding' => "UTF-16BE", 'confidence' => 1.0}
93
+ elsif aBuf[0, 3] == "\x2B\x2F\x76" && ["\x38", "\x39", "\x2B", "\x2F"].include?(aBuf[3, 1])
94
+ # NOTE: Ruby only includes "dummy" support for UTF-7.
95
+ # A Ruby UTF-7 string can't have methods called on it, nor can it be converted to anything else, but "BINARY"/"ASCII-8BIT".
96
+ # Still, this doesn't make detection useless, as UTF-7 encodings exist in the wild, and the scenario may need to be handled.
97
+ # 2B 2F 76 38 UTF-7
98
+ # 2B 2F 76 39 UTF-7
99
+ # 2B 2F 76 2B UTF-7
100
+ # 2B 2F 76 2F UTF-7
101
+ # 2B 2F 76 38 2D UTF-7 with no following character (empty string)
102
+ @result = {'encoding' => "UTF-7", 'confidence' => 0.99}
93
103
  end
94
104
  end
95
105
 
@@ -1,3 +1,3 @@
1
1
  module CharDet
2
- VERSION = "1.6.1"
2
+ VERSION = "1.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rchardet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-15 00:00:00.000000000 Z
12
+ date: 2018-01-07 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email:
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.2.2
78
+ rubygems_version: 2.6.14
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: Character encoding auto-detection in Ruby. As smart as your browser. Open