ruby-changes:44814
From: nagachika <ko1@a...>
Date: Thu, 24 Nov 2016 05:46:05 +0900 (JST)
Subject: [ruby-changes:44814] nagachika:r56887 (ruby_2_3): merge revision(s) 56881: [Backport #12972]
nagachika 2016-11-24 05:45:58 +0900 (Thu, 24 Nov 2016) New Revision: 56887 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56887 Log: merge revision(s) 56881: [Backport #12972] Don't encode to UTF-8 if it's unnecessary. If the file system encoding is ISO-8851-1 or if the encoding of the target string is invalid, don't encode to UTF-8. [ruby-core:78271] [Bug#12972] Modified directories: branches/ruby_2_3/ Modified files: branches/ruby_2_3/ChangeLog branches/ruby_2_3/test/ruby/test_dir_m17n.rb branches/ruby_2_3/version.h Index: ruby_2_3/version.h =================================================================== --- ruby_2_3/version.h (revision 56886) +++ ruby_2_3/version.h (revision 56887) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1 #define RUBY_VERSION "2.3.3" -#define RUBY_RELEASE_DATE "2016-11-21" -#define RUBY_PATCHLEVEL 222 +#define RUBY_RELEASE_DATE "2016-11-24" +#define RUBY_PATCHLEVEL 223 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 11 -#define RUBY_RELEASE_DAY 21 +#define RUBY_RELEASE_DAY 24 #include "ruby/version.h" Index: ruby_2_3/test/ruby/test_dir_m17n.rb =================================================================== --- ruby_2_3/test/ruby/test_dir_m17n.rb (revision 56886) +++ ruby_2_3/test/ruby/test_dir_m17n.rb (revision 56887) @@ -376,7 +376,9 @@ class TestDir_M17N < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_dir_m17n.rb#L376 bug12081 = '[ruby-core:73868] [Bug #12081]' a = "*".force_encoding("us-ascii") result = Dir[a].map {|n| - if n.encoding == Encoding::ASCII_8BIT + if n.encoding == Encoding::ASCII_8BIT || + n.encoding == Encoding::ISO_8859_1 || + !n.valid_encoding? n.force_encoding(Encoding::UTF_8) else n.encode(Encoding::UTF_8) Index: ruby_2_3/ChangeLog =================================================================== --- ruby_2_3/ChangeLog (revision 56886) +++ ruby_2_3/ChangeLog (revision 56887) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1 +Thu Nov 24 05:44:04 2016 CHIKANAGA Tomoyuki <nagachika@r...> + + * test/ruby/test_dir_m17n.rb: Don't encode to UTF-8 if it's unnecessary. + If the file system encoding is ISO-8851-1 or if the encoding of the + target string is invalid, don't encode to UTF-8. [Bug#12972] + Mon Nov 21 16:55:15 2016 boshan <boshan@s...> * lib/tempfile.rb (Tempfile#initialize): [DOC] the first parameter Property changes on: ruby_2_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r56881 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/