Permalink
Browse files

Merge pull request #12 from Holek/patch-1

fix for detect_encoding returning a hash without :encoding key
  • Loading branch information...
2 parents c8e2a5f + 3554229 commit bbcc495d896be222357e977f5a59bd92320bf42f @brianmario committed Sep 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/charlock_holmes/string.rb
@@ -26,7 +26,7 @@ def detect_encodings(hint_enc=nil)
# Returns: self
def detect_encoding!(hint_enc=nil)
if detected = self.detect_encoding(hint_enc)
- self.force_encoding detected[:encoding]
+ self.force_encoding(detected[:encoding]) if detected[:encoding]
end
self
end

0 comments on commit bbcc495

Please sign in to comment.