diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-22 03:16:52 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-22 03:16:52 +0000 |
commit | a532dcafe6f523b79024cb1ee7cff31cc1127ae3 (patch) | |
tree | 5b5a4bbcd3a3c918155b6c9043908857fada77fa /string.c | |
parent | 7a9cf391cd9f9fafaf66c7167c57a32a3efb0ab4 (diff) | |
download | ruby-a532dcafe6f523b79024cb1ee7cff31cc1127ae3.tar.gz |
* string.c (rb_str_inspect): string of ascii incompatible encoding
should be escaped and returned as US-ASCII encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -3663,6 +3663,7 @@ rb_str_inspect(VALUE str) char *p, *pend; VALUE result = rb_str_buf_new2(""); + if (!rb_enc_asciicompat(enc)) enc = rb_usascii_encoding(); rb_enc_associate(result, enc); str_cat_char(result, '"', enc); p = RSTRING_PTR(str); pend = RSTRING_END(str); |