From: duerst@... Date: 2016-05-17T08:28:08+00:00 Subject: [ruby-dev:49625] [Ruby trunk Bug#12368] default encoding of Integer#chr Issue #12368 has been updated by Martin Dürst. What about making the default UTF-8. This is the same as source encoding for many scripts now. According to the experts at the Ruby Committer meeting, the information about the script encoding is only available in the parser. ---------------------------------------- Bug #12368: default encoding of Integer#chr https://bugs.ruby-lang.org/issues/12368#change-58685 * Author: Usaku NAKAMURA * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- 現状、`Integer#chr`は引数なしの場合には、 1. default internalが設定されていればそれを使う 2. default internalが`nil`ならASCII(-8BIT)とみなす という挙動になっていますが、2の部分についてはかつてscript encodingのデフォルトがUS-ASCIIだった時代の名残のような気がします。 というわけで、2の場合にはscript encodingとみなすのが正しいのではないでしょうか。 ---Files-------------------------------- chr.diff (1.51 KB) -- https://bugs.ruby-lang.org/