ruby-changes:2903
From: ko1@a...
Date: 21 Dec 2007 13:09:56 +0900
Subject: [ruby-changes:2903] akr - Ruby:r14394 (trunk): * encoding.c (rb_locale_charmap): return nil if no locale information.
akr 2007-12-21 13:09:45 +0900 (Fri, 21 Dec 2007) New Revision: 14394 Modified files: trunk/ChangeLog trunk/encoding.c trunk/ruby.c Log: * encoding.c (rb_locale_charmap): return nil if no locale information. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ruby.c?r1=14394&r2=14393 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14394&r2=14393 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=14394&r2=14393 Index: encoding.c =================================================================== --- encoding.c (revision 14393) +++ encoding.c (revision 14394) @@ -714,7 +714,7 @@ codeset = nl_langinfo(CODESET); return rb_str_new2(codeset); #else - return rb_str_new2("ASCII-8BIT"); + return Qnil; #endif } Index: ChangeLog =================================================================== --- ChangeLog (revision 14393) +++ ChangeLog (revision 14394) @@ -1,3 +1,7 @@ +Fri Dec 21 13:09:11 2007 Tanaka Akira <akr@f...> + + * encoding.c (rb_locale_charmap): return nil if no locale information. + Fri Dec 21 12:55:39 2007 Tanaka Akira <akr@f...> * lib/runit, lib/rubyunit.rb, test/testunit/runit: removed. Index: ruby.c =================================================================== --- ruby.c (revision 14393) +++ ruby.c (revision 14394) @@ -139,9 +139,12 @@ locale_encoding(void) { VALUE codeset = rb_locale_charmap(Qnil); - char *name = StringValueCStr(codeset); + char *name; int idx; + if (codeset == Qnil) + return rb_default_encoding(); + idx = rb_enc_find_index(name); if (idx < 0) return rb_default_encoding(); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml