[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: [newbie] specifying file encoding
From:       Emmanuel Touzery <emmanuel.touzery () wanadoo ! fr>
Date:       2003-09-23 20:38:56
[Download RAW message or body]

On Tuesday 23 of September 2003 21:15, Yvon Thoraval wrote:
> How could we secify the encoding of I/O files ???

a string is considered by ruby as encoded as <insert your locale here>. If you 
want to treat strings from other encodings, you can convert encoding using 
"iconv" (bundled with ruby 1.8); in your case, you can use iconv to convert 
the string to your local encoding (iso-8859-1) and then capitalize will work 
fine.

emmanuel

PS: better support for this is planned for ruby 2.0
-- 
"Droit devant soi, on ne peut pas aller bien loin"
	- Le petit prince, Antoine de Saint Exupéry


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic