From: Dreamcat Four Date: 2010-07-22T15:26:09+09:00 Subject: [ruby-core:31434] [Feature #3595] Theres no encoding to differentiate a stream of Binary data from an 8-Bit ASCII string Issue #3595 has been updated by Dreamcat Four. Hi, Well I was unaware of this. In that case the argument Bill has can be seen as an issue. Reading a file with the IO object would read the ASCII tags, and you wouldn't know what to do. The tags map to both Ascii 7-bit and ascii 8-bit anyway. It seems that the correct thing to do when reading a file through an IO object is set the encoding to Encoding::BINARY and ignore the ascii tags. Unless the ASCII tag says its a text file, then set the Encoding to ASCII. Thats pretty easy really. What prompted me to report this: Translating data from a Ruby hash object and simple Ruby types into a Plist representation. To give users a standard and appropriate way to differentiate between their Ruby strings which are either textual (ascii or unicode), and their persistent binary data. A StringIO object is clearly not intended to represent a stream of binary data, since you have declared a specific Encoding::BINARY. There is simply no compelling argument why Encoding::BINARY should be an alias of 8-bit ASCII. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/3595 ---------------------------------------- http://redmine.ruby-lang.org