1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (parser_str_new, rb_intern3): rb_default_encoding() renamed.

* ext/nkf/nkf.c (rb_nkf_putchar): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2007-12-21 20:11:17 +00:00
parent d7cc14d436
commit b211ed6460
3 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,9 @@
Sat Dec 22 05:09:43 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* parse.y (parser_str_new, rb_intern3): rb_default_encoding() renamed.
* ext/nkf/nkf.c (rb_nkf_putchar): ditto.
Sat Dec 22 03:54:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org> Sat Dec 22 03:54:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* encoding.c (rb_ascii_encoding): renamed from previous * encoding.c (rb_ascii_encoding): renamed from previous

View file

@ -64,7 +64,7 @@ rb_nkf_putchar(unsigned int c)
rb_encoding* rb_nkf_enc_get(const char *name) rb_encoding* rb_nkf_enc_get(const char *name)
{ {
int idx = rb_enc_find_index(name); int idx = rb_enc_find_index(name);
if (idx < 0) idx = rb_enc_replicate(name, rb_default_encoding()); if (idx < 0) idx = rb_enc_replicate(name, rb_ascii_encoding());
return rb_enc_from_index(idx); return rb_enc_from_index(idx);
} }

View file

@ -4844,7 +4844,7 @@ parser_str_new(const char *p, long n, rb_encoding *enc, int func)
if (!(func & STR_FUNC_REGEXP) && if (!(func & STR_FUNC_REGEXP) &&
rb_enc_asciicompat(enc) && rb_enc_asciicompat(enc) &&
rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) { rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
rb_enc_associate(str, rb_default_encoding()); rb_enc_associate(str, rb_ascii_encoding());
} }
return str; return str;
@ -8969,7 +8969,7 @@ rb_intern3(const char *name, long len, rb_encoding *enc)
} }
} }
if (m - name < len) id = ID_JUNK; if (m - name < len) id = ID_JUNK;
if (enc != rb_default_encoding()) { if (enc != rb_ascii_encoding()) {
/* /*
* this clause makes sense only when called from other than * this clause makes sense only when called from other than
* rb_intern_str() taking care of code-range. * rb_intern_str() taking care of code-range.
@ -8978,7 +8978,7 @@ rb_intern3(const char *name, long len, rb_encoding *enc)
for (; m <= name + len; ++m) { for (; m <= name + len; ++m) {
if (!ISASCII(*m)) goto mbstr; if (!ISASCII(*m)) goto mbstr;
} }
enc = rb_default_encoding(); enc = rb_ascii_encoding();
} }
mbstr:; mbstr:;
} }