Caleb Clausen wrote:
> On 8/7/09, Vít Ondruch <v.ondruch / tiscali.cz> wrote:
>> file, but I would like to see something in following manner:
>>
>> String.new 'zufällige_žluťou??ký', Encoding.CP852
> 
> You seem to be asking for the ability to have individual string
> literals have encoding different from that of the program as a whole.
> Why not this:
> 
> #encoding: ascii-8bit
> 'zufällige_žluťou??ký'.force_encoding 'cp852'
> 'some utf8 data'.force_encoding 'utf-8'
> 'some sjis data'.force_encoding 'sjis'

Hmmm, that is a good idea!!!

Which leads me to the question why is default encoding US-ASCII instead 
of ASCII-8BIT?

> Another challenge will be editing this file. There's no editor out
> there that could actually display this kind of thing correctly; you'll
> have to become proficient at editing it as binary, or at least find an
> editor than can tolerate arbitrary binary chars in its ascii.

Its almost the same challenge if you want to edit single file in 
different encoding than is your system encoding ... so its not relevant 
... in contrary, it could be even easier. Because in my case, I don't 
care much about content, since I need more encodings for testing.
-- 
Posted via http://www.ruby-forum.com/.