On Jul 22, 2010, at 1:46 AM, Joshua Ballanco wrote:

> On Jul 21, 2010, at 11:41 AM, Dreamcat Four wrote:
> 
>> Issue #3595 has been updated by Dreamcat Four.
>> 
>> 
>> And lets face it, if Encoding::BINARY were its own seperate encoding that shouldnt really hurt anybody. Given the definition of what binary data is. If a ruby programmer wants to continue using 8-Bit Ascii strings that shouldn't get broken.
> 
> Oh, one more thing...there is no such thing as an ASCII-8BIT string that isn't data. The high bit values don't map to any characters. There are derivative encodings that use these values for other characters, but they have their own names like "ISO8859_2". If someone wants an ASCII string, they'll use US-ASCII. I'd think it's safe to assume that ASCII-8BIT always implies binary data.

To illustrate the point:

> irb1.9
irb(main):001:0> "\xAA".force_encoding('ASCII-8BIT').encode('UTF-8')
Encoding::UndefinedConversionError: "\xAA" from ASCII-8BIT to UTF-8
	from (irb):1:in `encode'
	from (irb):1
	from /usr/local/bin/irb1.9:12:in `<main>'
irb(main):002:0> "\xAA".force_encoding('US-ASCII').encode('UTF-8')
Encoding::InvalidByteSequenceError: "\xAA" on US-ASCII
	from (irb):2:in `encode'
	from (irb):2
	from /usr/local/bin/irb1.9:12:in `<main>'
irb(main):003:0> "\xAA".force_encoding('ISO8859-2').encode('UTF-8')
=> ""