aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json/decoding_test.rb
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2009-02-15 04:09:50 +0900
committerJeremy Kemper <jeremy@bitsweat.net>2009-02-17 11:58:53 -0800
commit7c0e008973e594ebf53607362c1dfbe34b693600 (patch)
tree98ee6f2f540c071e452bc2abbbb76f8b35375a97 /activesupport/test/json/decoding_test.rb
parentb6e56efe07cb3c2e999216f995403aa9206226a2 (diff)
downloadrails-7c0e008973e594ebf53607362c1dfbe34b693600.tar.gz
rails-7c0e008973e594ebf53607362c1dfbe34b693600.tar.bz2
rails-7c0e008973e594ebf53607362c1dfbe34b693600.zip
Ruby 1.9 compat: fix JSON decoding to work properly with multibyte values
[#1969 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/test/json/decoding_test.rb')
-rw-r--r--activesupport/test/json/decoding_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb
index 558b03b90d..ebd46a851e 100644
--- a/activesupport/test/json/decoding_test.rb
+++ b/activesupport/test/json/decoding_test.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
require 'abstract_unit'
class TestJSONDecoding < Test::Unit::TestCase
@@ -10,6 +11,8 @@ class TestJSONDecoding < Test::Unit::TestCase
%({"returnTo":[1,"\\"a\\",", "b"]}) => {"returnTo" => [1, "\"a\",", "b"]},
%({a: "'", "b": "5,000"}) => {"a" => "'", "b" => "5,000"},
%({a: "a's, b's and c's", "b": "5,000"}) => {"a" => "a's, b's and c's", "b" => "5,000"},
+ # multibyte
+ %({"matzue": "松江", "asakusa": "浅草"}) => {"matzue" => "松江", "asakusa" => "浅草"},
%({a: "2007-01-01"}) => {'a' => Date.new(2007, 1, 1)},
%({a: "2007-01-01 01:12:34 Z"}) => {'a' => Time.utc(2007, 1, 1, 1, 12, 34)},
# no time zone