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

* encoding.c (get_filesystem_encoding):

add Encoding.filesystem_encoding [ruby-dev:39546]
  also see [ruby-core:25959]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2009-10-28 06:06:10 +00:00
parent 9f5f7b87ba
commit 8d9e64fb38
2 changed files with 24 additions and 0 deletions

View file

@ -1,7 +1,14 @@
Wed Oct 28 14:24:45 2009 NARUSE, Yui <naruse@ruby-lang.org>
* encoding.c (get_filesystem_encoding):
add Encoding.filesystem_encoding [ruby-dev:39546]
also see [ruby-core:25959]
Wed Oct 28 14:51:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/etc/etc.c (etc_each_group): fixed typo.
Wed Oct 28 13:02:10 2009 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb (Net::FTP#initialize): sets @binary to true.

View file

@ -1118,6 +1118,22 @@ rb_filesystem_encoding(void)
return enc;
}
/*
* call-seq:
* Encoding.filesystem_encoding => enc
*
* Returns filesystem encoding.
*
* It is locale encoding on Unix,
* the currrent ANSI (or OEM unless AreFileApisANSI) code page on Windows,
* UTF-8 on Mac OS X.
*/
static VALUE
get_filesystem_encoding(VALUE klass)
{
return rb_enc_from_encoding(rb_filesystem_encoding());
}
struct default_encoding {
int index; /* -2 => not yet set, -1 => nil */
rb_encoding *enc;
@ -1463,6 +1479,7 @@ Init_Encoding(void)
rb_define_method(rb_cEncoding, "_dump", enc_dump, -1);
rb_define_singleton_method(rb_cEncoding, "_load", enc_load, 1);
rb_define_singleton_method(rb_cEncoding, "filesystem_encoding", get_filesystem_encoding, 0);
rb_define_singleton_method(rb_cEncoding, "default_external", get_default_external, 0);
rb_define_singleton_method(rb_cEncoding, "default_external=", set_default_external, 1);
rb_define_singleton_method(rb_cEncoding, "default_internal", get_default_internal, 0);