Bug #1932: Marshal.load fails in case of the non-ascii Struct
http://redmine.ruby-lang.org/issues/show/1932

Author: Heesob Park
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.2dev (2009-08-12 trunk 24516) [i686-linux] 

Marshal.load results TypeError in case of the non-ascii Struct name and member.

In case of encoding UTF-8, it works fine.
But in the other encodings, it fails.

$ irb                       
irb(main):001:0> __ENCODING__
=> #<Encoding:ISO-8859-1>
irb(main):002:0> Résumé = Struct.new(:résumé) 
=> Résumé
irb(main):003:0> r = Résumé.new(10)               
=> #<struct Résumé résumé=10>
irb(main):004:0> Marshal.dump(r)
=> "\x04\bSI:\vR\xE9sum\xE9\x06:\rencoding\"\x0FISO-8859-1\x06I:\vr\xE9sum\xE9\x06;\x00@\x06i\x0F"
irb(main):005:0> Marshal.load(Marshal.dump(r))
TypeError: can't convert Résumé into String
        from (irb):5:in `load'
        from (irb):5
        from /usr/local/bin/irb:12:in `<main>'


----------------------------------------
http://redmine.ruby-lang.org