< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #5862 has been updated by Brian Ford.
Just to be clear, the -K options do set the source-code encoding, right?
Thanks,
Brian
----------------------------------------
Bug #5862: Strings not encoded in -E encoding
https://bugs.ruby-lang.org/issues/5862
Author: Brian Ford
Status: Rejected
Priority: Normal
Assignee:
Category: M17N
Target version:
ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
If I pass the -E option, the Encoding.default_external is set to that encoding, but the string in the -e code is not set to that encoding, nor is the value of __ENCODING__ set to it.
$ ruby -v -E ascii-8bit -e 'p "abc".encoding, Encoding.default_external, Encoding.default_internal, __ENCODING__'
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
#<Encoding:UTF-8>
#<Encoding:ASCII-8BIT>
nil
#<Encoding:UTF-8>
However, if I pass -Ka, the encodings for all of 1. Encoding.default_external, 2. the -e string literal, and 3. __ENCODING__ in -e code are set to eg ASCII-8BIT.
$ ruby -v -Ka -e 'p "abc".encoding, Encoding.default_external, Encoding.default_internal, __ENCODING__'
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
#<Encoding:ASCII-8BIT>
#<Encoding:ASCII-8BIT>
nil
#<Encoding:ASCII-8BIT>
If -E {enc} sets Encoding.default_external to {enc} and data read from IO streams is set to encoding Encoding.default_external, and STDIO is an IO stream, shouldn't passing -E {enc} cause the -e string literal to have encoding {enc}? If not, could someone please explain the exact semantics of these two different command line options.
Thanks,
Brian
--
http://redmine.ruby-lang.org