Skip to content

Commit

Permalink
force peeked encoding back to utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed May 28, 2015
1 parent d10425b commit 3526c61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/json/pure/parser.rb
Expand Up @@ -143,6 +143,12 @@ def parse
obj
end

if defined?(::Encoding)
def peek(*)
super.force_encoding(::Encoding::UTF_8)
end
end

private

def convert_encoding(source)
Expand Down

0 comments on commit 3526c61

Please sign in to comment.