Skip to content

Commit eaa7352

Browse files
authored
Merge pull request #10 from casperisfine/utf8-string-values
Parse string values as UTF-8
2 parents 980ac81 + b683d5b commit eaa7352

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/fast_jsonparser_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ def test_json_parse_is_working
3535
assert_equal result[:a], "Alpha"
3636
end
3737

38+
def test_string_encoding
39+
result = FastJsonparser.parse('"École"')
40+
assert_equal Encoding::UTF_8, result.encoding
41+
assert_equal "École", result
42+
end
43+
3844
def test_file_stream_is_working
3945
assert_nil FastJsonparser.load_many('./benchmark/nginx_json_logs.json') {}
4046
end

0 commit comments

Comments
 (0)