Skip to content

Commit

Permalink
the CharDet module should not be included
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhodges committed Aug 22, 2008
1 parent cdbfd0d commit c6a152c
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/rchardet.rb
Expand Up @@ -14,6 +14,9 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA # 02110-1301 USA
######################### END LICENSE BLOCK ######################### ######################### END LICENSE BLOCK #########################

$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))

require 'rchardet/charsetprober' require 'rchardet/charsetprober'
require 'rchardet/mbcharsetprober' require 'rchardet/mbcharsetprober'


Expand Down Expand Up @@ -51,11 +54,13 @@
require 'rchardet/sjisprober' require 'rchardet/sjisprober'
require 'rchardet/universaldetector' require 'rchardet/universaldetector'
require 'rchardet/utf8prober' require 'rchardet/utf8prober'
include CharDet
def CharDet.detect(aBuf) module CharDet
u = UniversalDetector.new def CharDet.detect(aBuf)
u.reset u = UniversalDetector.new
u.feed(aBuf) u.reset
u.close u.feed(aBuf)
return u.result u.close
end u.result
end
end

0 comments on commit c6a152c

Please sign in to comment.