Hi,
In message "Re: [ruby-core:19013] Re: Encodings::default_internal patch"
on Mon, 29 Sep 2008 15:03:34 +0900, "Michael Selig" <michael.selig / fs.com.au> writes:
|To assist further, I'd also like to make a few suggestions for Ruby itself:
|
|1. default_internal should always be set (like "default_external"). If not
|specified, I suggest it default to the same value as "default_external" -
|Note: not 100% backward compatible with 1.9.0. You can use mode "ext:-" in
|IO if you really need to suppress transcoding on input.
I believe default_internal should not be set (or set to nil) by
default. The nil for default_internal means no conversion from
external encoding, so I think it's quite similar to what you intended
above. I will add -U command line option to the interpreter which set
UTF-8 as default_internal.
|2. default_internal should not be able to be set to a non-ASCII compatible
|encoding (ensures compatability with ASCII string literals);
Fair enough. I'd like to add this restriction and check.
|3. IO#write and friends should be changed so that when writing a file with
|an external encoding of ASCII-8BIT, that no transcoding be attempted - ie:
|just write out the raw bytes. This will help with writing a file
|containing multiple or arbitrary encodings (you won't have to use
|force_encoding("ASCII-8BIT") all the time).
Agreed.
matz.