diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-28 18:13:45 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-28 18:13:45 +0000 |
commit | 50a860d00635c6de5e32fe753b3adae596192f6d (patch) | |
tree | be3def93895c7a46b2af01b4f7069170c5ea9380 /string.c | |
parent | 3cb57fb1c3c2b25bd94660c099f52489a1564354 (diff) |
* string.c (str_new): remove encoding assumption of empty string.
* hash.c ( rb_f_getenv, env_fetch, env_inspect): result of ENV should
be always ASCII-8BIT.
* object.c (nil_to_s): nil.to_s should be US-ASCII.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -365,9 +365,6 @@ str_new(VALUE klass, const char *ptr, long len) if (ptr) { memcpy(RSTRING_PTR(str), ptr, len); } - if (len == 0) { - ENCODING_CODERANGE_SET(str, rb_usascii_encindex(), ENC_CODERANGE_7BIT); - } STR_SET_LEN(str, len); RSTRING_PTR(str)[len] = '\0'; return str; |