summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-28 06:06:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-28 06:06:20 +0000
commit1521f9331e2aa74fd3248d9cb5392735a2eb36cc (patch)
tree050c2adb540083ec103192e102642e147d77e778 /test/ruby/test_marshal.rb
parent113c6d58e70dc426e6bd20b4d42043985b9ef43f (diff)
* marshal.c (r_symreal): default to ASCII-8BIT for non-ascii symbols,
otherwise it should be converted to US-ASCII in rb_intern_str() if possible. [ruby-core:43762][Bug #6209] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r--test/ruby/test_marshal.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 15951bff36..1dea7e14dd 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -455,6 +455,15 @@ class TestMarshal < Test::Unit::TestCase
assert_equal(o1, o2)
end
+ def test_marshal_symbol_ascii8bit
+ bug6209 = '[ruby-core:43762]'
+ o1 = "\xff".force_encoding("ASCII-8BIT").intern
+ m = Marshal.dump(o1)
+ o2 = nil
+ assert_nothing_raised(EncodingError, bug6209) {o2 = Marshal.load(m)}
+ assert_equal(o1, o2, bug6209)
+ end
+
class PrivateClass
def initialize(foo)
@foo = foo