diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-13 08:08:02 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-13 08:08:02 +0000 |
commit | 1f093e000b0d82bea863d4453c83f6825b6cfa78 (patch) | |
tree | f90d544a7271715926cb298c1e3d1c9c6f2903fa /marshal.c | |
parent | e66b242ba5a84b5155db45006f81b3ac99a5f8c0 (diff) | |
download | ruby-1f093e000b0d82bea863d4453c83f6825b6cfa78.tar.gz ruby-1f093e000b0d82bea863d4453c83f6825b6cfa78.tar.xz ruby-1f093e000b0d82bea863d4453c83f6825b6cfa78.zip |
merges r24015 from trunk into ruby_1_9_1.
--
* marshal.c (r_object0): set encoding only if the encoding is not US-ASCII.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1376,7 +1376,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) r_ivar(v, arg); *ivp = Qfalse; } - rb_enc_copy(str, v); + if (rb_enc_get_index(v) != rb_usascii_encindex()) + rb_enc_copy(str, v); if (rb_enc_get_index(str) != rb_utf8_encindex()) { #define f_gsub_bang(x,y,z) rb_funcall(x, rb_intern("gsub!"), 2, y, z) f_gsub_bang(str, rb_reg_new("\\\\u", 3, 0), rb_usascii_str_new_cstr("u")); |