diff --git a/test/jrjackson_test.rb b/test/jrjackson_test.rb index 1f0e608..94eac4f 100755 --- a/test/jrjackson_test.rb +++ b/test/jrjackson_test.rb @@ -468,6 +468,24 @@ def test_can_parse_big_decimals end + def test_can_parse_utf_16 + expected = { "key" => "value👍" } + json_utf_16 = '{"key": "value👍"}'.encode('UTF-16') + + actual = JrJackson::Json.load(json_utf_16) + + assert_equal(expected, actual) + end + + def test_can_parse_utf_32 + expected = { "key" => "value👍" } + json_utf_32 = '{"key": "value👍"}'.encode('UTF-32') + + actual = JrJackson::Json.load(json_utf_32) + + assert_equal(expected, actual) + end + def test_can_serialize_object obj = Object.new actual = JrJackson::Json.dump({"foo" => obj})