Bug #1918
closedinspect Struct.new results incompatible character encodings on non-ascii structure
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
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:ininspect': 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
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