Issue #3595 has been updated by Dreamcat Four.


Let me re-phase this another way:

Its simply a very poor assumption to say that the Encoding "BINARY" is an alias of ASCII-8-bit.

Its true that Ruby would store the string as an octet stream identically to an 8-bit ASCII octet stream. However the interpretation of the string in a running program is entirely different. On one hand, you're telling the program that the octet stream can be displayed as 8-bit ascii data (or can be transcoded to some other human-readable encoding).

On the other case, a binary string is always only an octet stream of binary data. It has a real and unique encoding which is not connected to the mappable domain of the other encodings.

In other words - 8-bit ascii is a mapping of glyphs. Raw binary data has no such ASCII glyphs and no mapping to those ASCII glyphs. If you think implementing a numerical conversion is unnecessary, then fine. Dont implement one. A string of unencoded binary data can always be transcoded to -> "" (empty string). Then theres no requirement to map the bits (or a hexadecimal representation) numerically onto an ASCII table.

----------------------------------------
http://redmine.ruby-lang.org/issues/show/3595

----------------------------------------
http://redmine.ruby-lang.org