File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ static VALUE make_ruby_object(dom::element element)
48
48
case dom::element_type::STRING:
49
49
{
50
50
std::string_view view (element);
51
- return rb_str_new (view.data (), view.size ());
51
+ return rb_utf8_str_new (view.data (), view.size ());
52
52
}
53
53
case dom::element_type::BOOL:
54
54
{
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
1
3
require "test_helper"
2
4
require 'tempfile'
3
5
require 'json'
@@ -18,6 +20,12 @@ def test_json_parse_is_working
18
20
assert_equal result [ :a ] , "Alpha"
19
21
end
20
22
23
+ def test_string_encoding
24
+ result = FastJsonparser . parse ( '"École"' )
25
+ assert_equal Encoding ::UTF_8 , result . encoding
26
+ assert_equal "École" , result
27
+ end
28
+
21
29
def test_file_stream_is_working
22
30
assert_nil FastJsonparser . load_many ( './benchmark/nginx_json_logs.json' ) { }
23
31
end
You can’t perform that action at this time.
0 commit comments