Skip to content

Commit

Permalink
Adding conditional hack to be compatible with Ruby 1.8/1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
speedmax committed Jul 3, 2009
1 parent d292665 commit 3fb43d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rchardet/universaldetector.rb
Expand Up @@ -60,7 +60,7 @@ def reset

def feed(aBuf)
# HACK: force internal encoding to be ascii-8bit (ruby 1.8 bytes)
aBuf = aBuf.force_encoding('ASCII-8BIT')
aBuf = aBuf.force_encoding('ASCII-8BIT') if aBuf.respond_to?(:force_encoding)
return if @done

aLen = aBuf.length
Expand Down

0 comments on commit 3fb43d5

Please sign in to comment.