Project

General

Profile

Actions

Bug #1353

closed

io does not convert str when ext == intern

Bug #1353: io does not convert str when ext == intern

Added by sheepman (Takashi Tamura) over 16 years ago. Updated over 14 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-07-06 trunk 23971) [x86_64-freebsd7.2]
Backport:
[ruby-dev:38278]

Description

=begin
こんばんは sheepman です。

IO の外部エンコーディングと内部エンコーディングが等しい場合に、
変換が必要な場合でも、変換が起きません。

$ cat t.rb

encoding:euc-jp

io = File.open('t.txt', 'w+', { :internal_encoding => "SJIS" } )
io.write("ほげ")

$ ruby-1.9 -v -Esjis t.rb
ruby 1.9.2dev (2009-04-04 trunk 23134) [i686-linux]

$ nkf --guess t.txt
EUC-JP
=end

Updated by naruse (Yui NARUSE) over 16 years ago Actions #1

=begin
成瀬です。

とりあえず先にこちらを。

sheepman wrote:

こんばんは sheepman です。

IO の外部エンコーディングと内部エンコーディングが等しい場合に、
変換が必要な場合でも、変換が起きません。

$ cat t.rb

encoding:euc-jp

io = File.open('t.txt', 'w+', { :internal_encoding => "SJIS" } )
io.write("ほげ")

内部エンコーディングの設定は、書き込み時のエンコーディング変換には影響しません。
またdefault_externalも、書き込み時のエンコーディング変換には影響しません。

--
NARUSE, Yui

=end

Updated by sheepman (Takashi Tamura) over 16 years ago Actions #2

=begin
こんばんは sheepman です。

On Sun, 5 Apr 2009 22:08:19 +0900
"NARUSE, Yui" wrote:

内部エンコーディングの設定は、書き込み時のエンコーディング変換には影響しません。
またdefault_externalも、書き込み時のエンコーディング変換には影響しません。

影響しているようです。

$ cat t.rb

encoding:euc-jp

io = File.open('t.txt', 'w+', { :internal_encoding => "EUC-JP"} )
io.write("ほげ")

$ ruby-1.9 -v -Esjis t.rb
ruby 1.9.2dev (2009-04-04 trunk 23134) [i686-linux]

$ nkf --guess t.txt
Shift_JIS

=end

Updated by naruse (Yui NARUSE) over 16 years ago Actions #3

=begin
成瀬です。

sheepman wrote:

内部エンコーディングの設定は、書き込み時のエンコーディング変換には影響しません。
またdefault_externalも、書き込み時のエンコーディング変換には影響しません。

影響しているようです。

うーむむ、確かに。
ちょっと[ruby-dev:38276]も含めて再整理します。

--
NARUSE, Yui

=end

Updated by sheepman (Takashi Tamura) over 16 years ago Actions #4

=begin
こんにちは sheepman です。

この件は結局どうなったのでしょうか?

成瀬です。

sheepman wrote:

内部エンコーディングの設定は、書き込み時のエンコーディング変換には影響しません。
またdefault_externalも、書き込み時のエンコーディング変換には影響しません。

影響しているようです。

うーむむ、確かに。
ちょっと[ruby-dev:38276]も含めて再整理します。

=end

Updated by naruse (Yui NARUSE) over 16 years ago Actions #5

  • Status changed from Open to Assigned
  • Assignee set to naruse (Yui NARUSE)
  • ruby -v set to ruby 1.9.2dev (2009-07-06 trunk 23971) [x86_64-freebsd7.2]

=begin

=end

Updated by naruse (Yui NARUSE) over 16 years ago Actions #6

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r23976.
=end

Actions

Also available in: PDF Atom