Project

General

Profile

Actions

Bug #1918

closed

inspect Struct.new results incompatible character encodings on non-ascii structure

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

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-08-10 trunk 24489) [i686-linux]
Backport:
[ruby-core:24849]

Description

=begin
inspect Struct.new results incompatible character encodings on non-ascii name and member.

$ ruby -e "Résumé = Struct.new(:résumé);p Résumé.new"
-e:1:in inspect': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError) from -e:1:in p'
from -e:1:in `'
=end

Actions #1

Updated by fjc (Frank Cameron) over 15 years ago

=begin

ruby1.9 -e "Résumé = Struct.new(:résumé);p Résumé.new"
-e:1:in inspect': append incompatible encoding strings: ASCII-8BIT and UTF-8 (ArgumentError) from -e:1:in p'
from -e:1:in `'
ruby1.9 -e "Résumé = Struct.new(:rsum);p Résumé.new"
#<struct Résumé rsum=nil>
ruby1.9 -e "Rsum = Struct.new(:résumé);p Rsum.new"
#<struct Rsum résumé=nil>

struct.c, in inspect_struct:
499 const char *cname = rb_class2name(rb_obj_class(s));
512 str = rb_sprintf("#<struct %s ", cname);
521 slot = RARRAY_PTR(members)[i];
522 id = SYM2ID(slot);
524 rb_str_append(str, rb_id2str(id));
=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24513.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0