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

* encoding.c (enc_set_default_encoding): should not treat US-ASCII

special here.  a patch from Yui NARUSE in [ruby-dev:37769].
  [ruby-dev:37699]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-01-15 06:57:55 +00:00
parent 2a0b6280bb
commit 80088a55fc
2 changed files with 9 additions and 6 deletions

View file

@ -1,3 +1,9 @@
Thu Jan 15 15:55:31 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* encoding.c (enc_set_default_encoding): should not treat US-ASCII
special here. a patch from Yui NARUSE in [ruby-dev:37769].
[ruby-dev:37699]
Thu Jan 15 14:27:27 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
* LEGAL: Added information for missing/langinfo.c

View file

@ -1050,8 +1050,7 @@ struct default_encoding {
};
static int
enc_set_default_encoding(struct default_encoding *def, VALUE encoding,
const char *name, int defindex)
enc_set_default_encoding(struct default_encoding *def, VALUE encoding, const char *name)
{
int overridden = Qfalse;
if (def->index != -2)
@ -1066,8 +1065,6 @@ enc_set_default_encoding(struct default_encoding *def, VALUE encoding,
}
else {
def->index = rb_enc_to_index(rb_to_encoding(encoding));
if (def->index == ENCINDEX_US_ASCII)
def->index = defindex;
def->enc = 0;
enc_alias_internal(name, def->index);
}
@ -1118,7 +1115,7 @@ rb_enc_set_default_external(VALUE encoding)
rb_raise(rb_eArgError, "default external can not be nil");
}
enc_set_default_encoding(&default_external, encoding,
"external", ENCINDEX_US_ASCII);
"external");
}
/*
@ -1171,7 +1168,7 @@ void
rb_enc_set_default_internal(VALUE encoding)
{
enc_set_default_encoding(&default_internal, encoding,
"internal", ENCINDEX_UTF_8);
"internal");
}
/*