[#111712] [Ruby master Feature#19322] Support spawning "private" child processes — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5MzIyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu
14 messages
2023/01/07
[ruby-core:112099] [Ruby master Bug#19235] StringIO.new(encoding: "ext_enc:int_enc") doesn't set external encoding
From:
"andrykonchin (Andrew Konchin) via ruby-core" <ruby-core@...>
Date:
2023-01-28 14:08:55 UTC
List:
ruby-core #112099
Issue #19235 has been updated by andrykonchin (Andrew Konchin).
Yeah, so this issue is a duplicate. My bad (.
So this issue probably should be closed.
----------------------------------------
Bug #19235: StringIO.new(encoding: "ext_enc:int_enc") doesn't set external encoding
https://bugs.ruby-lang.org/issues/19235#change-101533
* Author: andrykonchin (Andrew Konchin)
* Status: Open
* Priority: Normal
* ruby -v: 3.1.2
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
I noticed a divergence between IO `:encoding` option documentation and StringIO's behaviour:
```ruby
io = StringIO.new('', 'w', encoding: 'utf-8:ISO-8859-1')
io.external_encoding # => #<Encoding:ISO-8859-1>
```
According to the [documentation](https://ruby-doc.org/3.1.3/IO.html#class-IO-label-Open+Options):
```
:encoding: Specifies external and internal encodings as 'extern:intern'.
```
The IO class behaves in expected way:
```ruby
f = File.open("test.txt", 'w', encoding: 'UTF-8:ISO-8859-1')
f.external_encoding # => #<Encoding:UTF-8>
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/