[前][次][番号順一覧][スレッド一覧]

ruby-changes:18014

From: yugui <ko1@a...>
Date: Thu, 2 Dec 2010 17:06:47 +0900 (JST)
Subject: [ruby-changes:18014] Ruby:r30035 (ruby_1_9_2): merges r29438 from trunk into ruby_1_9_2.

yugui	2010-12-02 17:06:29 +0900 (Thu, 02 Dec 2010)

  New Revision: 30035

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30035

  Log:
    merges r29438 from trunk into ruby_1_9_2.
    --
    * error.c (syserr_initialize): set the encoding of Errno::*#message
      as locale. [ruby-dev:42358]

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/error.c
    branches/ruby_1_9_2/test/ruby/test_exception.rb
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 30034)
+++ ruby_1_9_2/ChangeLog	(revision 30035)
@@ -1,3 +1,8 @@
+Mon Oct 11 14:03:54 2010  NARUSE, Yui  <naruse@r...>
+
+	* error.c (syserr_initialize): set the encoding of Errno::*#message
+	  as locale. [ruby-dev:42358]
+
 Mon Oct 11 06:11:30 2010  NARUSE, Yui  <naruse@r...>
 
 	* io.c (rb_io_set_encoding): use rb_funcall2 when the io is not
Index: ruby_1_9_2/error.c
===================================================================
--- ruby_1_9_2/error.c	(revision 30034)
+++ ruby_1_9_2/error.c	(revision 30035)
@@ -1045,6 +1045,7 @@
     else {
 	mesg = rb_str_new2(err);
     }
+    rb_enc_associate(mesg, rb_locale_encoding());
     rb_call_super(1, &mesg);
     rb_iv_set(self, "errno", error);
     return self;
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 30034)
+++ ruby_1_9_2/version.h	(revision 30035)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 65
+#define RUBY_PATCHLEVEL 66
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_2/test/ruby/test_exception.rb
===================================================================
--- ruby_1_9_2/test/ruby/test_exception.rb	(revision 30034)
+++ ruby_1_9_2/test/ruby/test_exception.rb	(revision 30035)
@@ -312,4 +312,8 @@
     e = assert_raise(NoMethodError) {str.__send__(id)}
     assert_equal("undefined method `#{id}' for #{str.inspect}:String", e.message, bug3237)
   end
+
+  def test_errno
+    assert_equal(Encoding.find("locale"), Errno::EINVAL.new.message.encoding)
+  end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]