From: shugo@... Date: 2016-11-17T04:24:03+00:00 Subject: [ruby-core:78181] [Ruby trunk Bug#12949] Loading rbconfig.rb fails if it contains non-ASCII characters and -K is specified Issue #12949 has been reported by Shugo Maeda. ---------------------------------------- Bug #12949: Loading rbconfig.rb fails if it contains non-ASCII characters and -K is specified https://bugs.ruby-lang.org/issues/12949 * Author: Shugo Maeda * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- TestRubyOptions#test_kanji fails on icc-x64 chkbuild. From http://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20161117T010002Z.fail.html.gz: ``` 1) Failure: TestRubyOptions#test_kanji [/home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/test/ruby/test_rubyoptions.rb:143]: 1. [1/2] Assertion for "stdout" | <["EUC-JP"]> expected but was | <[]>. 2. [2/2] Assertion for "stderr" | <[]> expected but was | <["/home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/rbconfig.rb:279:in `gsub': invalid byte sequence in EUC-JP (ArgumentError)", | "\tfrom /home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/rbconfig.rb:279:in `expand'", | "\tfrom /home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/rbconfig.rb:297:in `block in '", | "\tfrom /home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/rbconfig.rb:296:in `each_value'", | "\tfrom /home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/rbconfig.rb:296:in `'", | "\tfrom /home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/rbconfig.rb:10:in `'", | "\tfrom /home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/lib/rubygems.rb:9:in `require'", | "\tfrom /home/chkbuild/chkbuild/tmp/build/20161117T010002Z/ruby/lib/rubygems.rb:9:in `'", | "\tfrom :4:in `require'", | "\tfrom :4:in `'"]>. ``` This is because `RbConfig::CONFIG["CC_VERSION_MESSAGE"]` contains non-ASCII characters, and can be fixed by adding a magic comment to rbconfig.rb. But which encoding should be specified? Possible options are: 1. ASCII-8BIT. It's reasonable when we can't know the correct encoding, but there may be compatibility issues. 2. UTF-8. UTF-8 is the default source encoding, so there is no compatibility issue because the current behavior when -K is specified is a run-time error. 3. The encoding of the locale at the time when ruby is compiled. -- https://bugs.ruby-lang.org/ Unsubscribe: