summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-14 19:13:20 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-10-31 13:22:33 +0900
commitdcb35811cf240f771a0587ee20ec54b10594ff52 (patch)
tree5733d0a98aafe6c1aa4f7bdcf2a46a8d1769cd8a /tests
parentfd3873c0a32b4127e3178bf65bf5b114d3ab8de3 (diff)
downloadjson-dcb35811cf240f771a0587ee20ec54b10594ff52.tar.gz
[flori/json] Fixed unexpected illegal/malformed utf-8 error
flori/json@c34d01ff6a18dac04a90b2e0f820cdb1d5c7e1b2 does not consider US-ASCII compatible but non-UTF-8 encodings, and causes an error in RDoc tests. https://github.com/flori/json/commit/4f471bf590
Diffstat (limited to 'tests')
-rw-r--r--tests/json_generator_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/json_generator_test.rb b/tests/json_generator_test.rb
index a85bd11..3d9ab7a 100644
--- a/tests/json_generator_test.rb
+++ b/tests/json_generator_test.rb
@@ -411,4 +411,10 @@ EOT
assert_equal '["foo"]', JSON.generate([s.new('foo')])
end
end
+
+ if defined?(Encoding)
+ def test_nonutf8_encoding
+ assert_equal("\"5\u{b0}\"", "5\xb0".force_encoding("iso-8859-1").to_json)
+ end
+ end
end