Project

General

Profile

Actions

Bug #1932

closed

Marshal.load fails in case of the non-ascii Struct

Added by phasis68 (Heesob Park) over 14 years ago. Updated about 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-08-12 trunk 24516) [i686-linux]
Backport:
[ruby-core:24882]

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

Actions #1

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

Actions

Also available in: Atom PDF

Like0
Like0