rchardet 1.2 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,7 +63,8 @@ module CharDet
63
63
  end
64
64
 
65
65
  def feed(aBuf)
66
- for c in aBuf.split('')
66
+ aBuf.each_byte do |b|
67
+ c = b.chr
67
68
  for codingSM in @_mCodingSM
68
69
  next unless codingSM
69
70
  next unless codingSM.active
@@ -181,7 +181,7 @@ EError,EError,EError,EItsMe,EError,EError,EError,EError,# 38-3f
181
181
  EError,EError,EError,EError,EItsMe,EError,EStart,EStart,# 40-47
182
182
  ]
183
183
 
184
- ISO2022JPCharLenTable = [0, 0, 0, 0, 0, 0, 0, 0]
184
+ ISO2022JPCharLenTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
185
185
 
186
186
  ISO2022JPSMModel = {'classTable' => ISO2022JP_cls,
187
187
  'classFactor' => 10,
@@ -109,7 +109,8 @@ module CharDet
109
109
 
110
110
  def feed(aBuf)
111
111
  aBuf = filter_with_english_letters(aBuf)
112
- for c in aBuf.split('')
112
+ aBuf.each_byte do |b|
113
+ c = b.chr
113
114
  charClass = Latin1_CharToClass[c[0]]
114
115
  freq = Latin1ClassModel[(@_mLastCharClass * CLASS_NUM) + charClass]
115
116
  if freq == 0
@@ -71,7 +71,8 @@ module CharDet
71
71
  if not aLen
72
72
  return get_state()
73
73
  end
74
- for c in aBuf.split('')
74
+ aBuf.each_byte do |b|
75
+ c = b.chr
75
76
  order = @_mModel['charToOrderMap'][c[0]]
76
77
  if order < SYMBOL_CAT_ORDER
77
78
  @_mTotalChar += 1
@@ -47,7 +47,8 @@ module CharDet
47
47
  end
48
48
 
49
49
  def feed(aBuf)
50
- for c in aBuf.split('')
50
+ aBuf.each_byte do |b|
51
+ c = b.chr
51
52
  codingState = @_mCodingSM.next_state(c)
52
53
  if codingState == EError
53
54
  @_mState = ENotMe
data/lib/rchardet.rb CHANGED
@@ -56,7 +56,7 @@ require 'rchardet/universaldetector'
56
56
  require 'rchardet/utf8prober'
57
57
 
58
58
  module CharDet
59
- VERSION = "1.2"
59
+ VERSION = "1.3"
60
60
  def CharDet.detect(aBuf)
61
61
  u = UniversalDetector.new
62
62
  u.reset
@@ -64,4 +64,4 @@ module CharDet
64
64
  u.close
65
65
  u.result
66
66
  end
67
- end
67
+ 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.2"
4
+ version: "1.3"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Hodges
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-22 00:00:00 -07:00
12
+ date: 2009-07-19 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -23,7 +23,6 @@ extra_rdoc_files:
23
23
  - README
24
24
  - COPYING
25
25
  files:
26
- - lib/rchardet
27
26
  - lib/rchardet/big5freq.rb
28
27
  - lib/rchardet/big5prober.rb
29
28
  - lib/rchardet/chardistribution.rb
@@ -61,8 +60,10 @@ files:
61
60
  - lib/rchardet.rb
62
61
  - README
63
62
  - COPYING
64
- has_rdoc: false
63
+ has_rdoc: true
65
64
  homepage: http://github.com/jmhodges/rchardet/tree/master
65
+ licenses: []
66
+
66
67
  post_install_message:
67
68
  rdoc_options: []
68
69
 
@@ -83,9 +84,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
84
  requirements: []
84
85
 
85
86
  rubyforge_project: rchardet
86
- rubygems_version: 1.2.0
87
+ rubygems_version: 1.3.4
87
88
  signing_key:
88
- specification_version: 2
89
+ specification_version: 3
89
90
  summary: Character encoding auto-detection in Ruby. As smart as your browser. Open source.
90
91
  test_files: []
91
92