« Return to Thread: Ruby 1.8 - character encoding

Re: Ruby 1.8 - character encoding

by Gregory Brown :: Rate this Message:

Reply to Author | View in Thread

On Tue, Jul 7, 2009 at 10:42 AM, Gregory Brown<gregory.t.brown@...> wrote:

> On Tue, Jul 7, 2009 at 10:21 AM, Thomas Thomassen<thomas@...> wrote:
>> Gregory Brown wrote:
>>> http://blog.grayproductions.net/categories/character_encodings
>>
>> I have seen that series. I still can't work out how Ruby determines what
>> UTF-8 character to map to the 128-255 spaces.
>
> I  missed why you wouldn't just set $KCODE="U" and stick w. UTF-8?
>
> Anyway, I *think* chars.pack("C*") is going to give you ISO-8859-1 but
> someone else will need to verify for you.

Also, since you know the original encoding, you can use IConv to
explicitly convert to whatever you want.

-greg

 « Return to Thread: Ruby 1.8 - character encoding