On Mon, Sep 12, 2011 at 7:45 PM, Brian Candler <b.candler / pobox.com> wrote:
> Robert Klemme wrote in post #1021429:
>> irb(main):002:0> u.names
>> => ["ASCII-8BIT", "BINARY"]
>>
>> In other words: binary and ASCII-8BIT are the same.
>
> Indeed.
>
>> I find the behavior totally consistent
>
> Consistent with what? If you set external_encoding to something other
> than nil, you are telling ruby to transcode strings on output to the
> given encoding - *unless* the given encoding is "ASCII-8BIT"/"BINARY".
>
> So it seems that "ASCII-8BIT" is handled as a special case. In fact,
> looking at io.c, that encoding is handled as a special case all over the
> place:

The only special thing is that it is the "encoding" of a String's raw
data, I'd say.

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/