Project

General

Profile

Actions

Bug #924

closed

encoding for stdio's

Added by yugui (Yuki Sonoda) almost 16 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.2
Backport:
[ruby-dev:37576]

Description

=begin
Yuguiです。

stdout, stderrのexternal encodingがnilなのはこういうものでしたっけ?
default_externalを期待してました。

それから、-Eext:intしたときには少なくともinternal_encodingに反映された方
が使いやすいと思うのですが、いかがでしょうか。

% cat test.rb
p [STDIN, STDOUT, STDERR].map{|io|
[io.external_encoding, io.internal_encoding]
}

% ruby-trunk -v test.rb

ruby 1.9.1 (2008-12-22 p-5000 trunk-r20912) [i386-darwin9.6.0]
#<a href="Encoding:UTF-8" class="external">Encoding:UTF-8</a>, nil], [nil, nil], [nil, nil

% ruby-trunk -vEcp932 test.rb
ruby 1.9.1 (2008-12-22 p-5000 trunk-r20912) [i386-darwin9.6.0]
#<a href="Encoding:Windows-31J" class="external">Encoding:Windows-31J</a>, nil], [nil, nil], [nil, nil

% ruby-trunk -vE:euc-jp test.rb
ruby 1.9.1 (2008-12-22 p-5000 trunk-r20912) [i386-darwin9.6.0]
#<a href="Encoding:UTF-8" class="external">Encoding:UTF-8</a>, nil], [nil, nil], [nil, nil

% ruby-trunk -vEcp932:euc-jp test.rb

ruby 1.9.1 (2008-12-22 p-5000 trunk-r20912) [i386-darwin9.6.0]
#<a href="Encoding:Windows-31J" class="external">Encoding:Windows-31J</a>, nil], [nil, nil], [nil, nil

--
Yugui
http://yugui.jp
私は私をDumpする
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0