summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/json/json_generator_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb
index 86be398..d7f9ebe 100644
--- a/test/json/json_generator_test.rb
+++ b/test/json/json_generator_test.rb
@@ -374,4 +374,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