Bug #1932
closedMarshal.load fails in case of the non-ascii Struct
Description
=begin
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
'
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r25387.
Heesob, thank you for your reporting of the issue.
You have greatfully contributed toward Ruby.
May Ruby be with you.
=end