mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (rb_enc_set_default_external): default_internal can be
nil, but default_external cannot. * encoding.c (rb_set_default_internal): adds rdoc. * encoding.c (enc_find): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63a534194c
commit
58740ef881
2 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
|||
Fri Dec 12 19:29:07 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* encoding.c (rb_enc_set_default_external): default_internal can be
|
||||
nil, but default_external cannot.
|
||||
|
||||
* encoding.c (rb_set_default_internal): adds rdoc.
|
||||
|
||||
* encoding.c (enc_find): ditto.
|
||||
|
||||
Fri Dec 12 19:24:47 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* common.mk (run, runruby, parse, gdb, gdb-ruby): you can also run
|
||||
|
|
|
@ -905,6 +905,9 @@ enc_list(VALUE klass)
|
|||
* Encoding.find("US-ASCII") => #<Encoding:US-ASCII>
|
||||
* Encoding.find(:Shift_JIS) => #<Encoding:Shift_JIS>
|
||||
*
|
||||
* An ArgumentError is raised when no encoding with <i>name</i>.
|
||||
* Only +Encoding.find("internal")+ however returns nil when no encoding named "internal",
|
||||
* in other words, when Ruby has no default internal encoding.
|
||||
*/
|
||||
static VALUE
|
||||
enc_find(VALUE klass, VALUE enc)
|
||||
|
@ -1102,6 +1105,9 @@ get_default_external(VALUE klass)
|
|||
void
|
||||
rb_enc_set_default_external(VALUE encoding)
|
||||
{
|
||||
if (NIL_P(encoding)) {
|
||||
rb_raise(rb_eArgError, "default external can not be nil");
|
||||
}
|
||||
enc_set_default_encoding(&default_external, encoding,
|
||||
"external", ENCINDEX_US_ASCII);
|
||||
}
|
||||
|
@ -1161,9 +1167,10 @@ rb_enc_set_default_internal(VALUE encoding)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* Encoding.default_internal = enc
|
||||
* Encoding.default_internal = enc or nil
|
||||
*
|
||||
* Sets default internal encoding.
|
||||
* Or removes default internal encoding when passed nil.
|
||||
*/
|
||||
static VALUE
|
||||
set_default_internal(VALUE klass, VALUE encoding)
|
||||
|
|
Loading…
Reference in a new issue