Permalink
Browse files

fuck me. broke utf-16 encoding checks with single quotes.

  • Loading branch information...
1 parent 3688fc9 commit cdbfd0d43be28559688df5b2dbbd11fab2d37b3e @jmhodges committed Aug 22, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/rchardet/universaldetector.rb
View
4 lib/rchardet/universaldetector.rb 100755 → 100644
@@ -81,10 +81,10 @@ def feed(aBuf)
elsif aBuf[0...4] == "\x00\x00\xFF\xFE"
# 00 00 FF FE UCS-4, unusual octet order BOM (2143)
@result = {'encoding' => "X-ISO-10646-UCS-4-2143", 'confidence' => 1.0}
- elsif aBuf[0...2] == '\xFF\xFE' # FIXME BUGME bug in python chardet was [:4]
+ elsif aBuf[0...2] == "\xFF\xFE"
# FF FE UTF-16, little endian BOM
@result = {'encoding' => "UTF-16LE", 'confidence' => 1.0}
- elsif aBuf[0...2] == '\xFE\xFF'
+ elsif aBuf[0...2] == "\xFE\xFF"
# FE FF UTF-16, big endian BOM
@result = {'encoding' => "UTF-16BE", 'confidence' => 1.0}
end

0 comments on commit cdbfd0d

Please sign in to comment.