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:
parent
2a0b6280bb
commit
80088a55fc
2 changed files with 9 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue