ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:50975] [Ruby master Bug#10417] IO#set_encoding without int_enc doesn't keep current internal encoding
       [not found] <redmine.issue-10417.20141022155011.9@ruby-lang.org>
@ 2020-12-10  8:44 ` naruse
  0 siblings, 0 replies; only message in thread
From: naruse @ 2020-12-10  8:44 UTC (permalink / raw)
  To: ruby-dev

Issue #10417 has been updated by naruse (Yui NARUSE).

Status changed from Open to Closed

特に困っているって言う例を聞かないので一旦クローズします

----------------------------------------
Bug #10417: IO#set_encoding without int_enc doesn't keep current internal encoding
https://bugs.ruby-lang.org/issues/10417#change-89082

* Author: usa (Usaku NAKAMURA)
* Status: Closed
* Priority: Normal
* Target version: 3.0
* ruby -v: -
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
bugかfeatureか迷ったんですが、とりあえずbugで。

`IO#set_encoding`を1引数で呼び出したとき、つまりexternal encodingのみを指定した場合、internal encodingは`nil`が指定されたとみなされ、`Encoding.default_inernal`が設定されます。
従って、もともとこのIOにinternal encodingが設定されていた場合、それが上書きされてしまいます。
internal encodingを指定せずに呼び出した場合は、現在の値を保持すべきではないでしょうか?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-10  8:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-10417.20141022155011.9@ruby-lang.org>
2020-12-10  8:44 ` [ruby-dev:50975] [Ruby master Bug#10417] IO#set_encoding without int_enc doesn't keep current internal encoding naruse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).