Ruby (not rails) internationalization

I have some web page which contains accented words (in french/italian
etc) which I need to parse/extract and display. But the
internationalization is not being taken into consideration so crazy
characters are being shown. I searched in google for ruby
internationalization but came up with rails internationalization. As you
know that I don’t need rails right now (which btw, I have no knowledge
in). I just need to work in plain ruby. I don’t know how
internationalization is dealt with in regular ruby. Can someone throw
some light on this?

Thanks.

Try use the i18n http://github.com/svenfuchs/i18n gem or
r18nhttp://github.com/ai/r18ngem.

Rafael Mendonça França
Twitter: http://twitter.com/rafaelfranca
Blog: www.rafaelfranca.com.br

On Wed, Mar 10, 2010 at 10:23 PM, Amishera Amishera

On Thu, Mar 11, 2010 at 10:23 AM, Amishera Amishera
[email protected] wrote:

I have some web page which contains accented words (in french/italian
etc) which I need to parse/extract and display. But the
internationalization is not being taken into consideration so crazy
characters are being shown. I searched in google for ruby
internationalization but came up with rails internationalization. As you
know that I don’t need rails right now (which btw, I have no knowledge
in). I just need to work in plain ruby. I don’t know how
internationalization is dealt with in regular ruby. Can someone throw
some light on this?

Easiest is to use Ruby 1.9 with Nokogiri for the HTML parsing.
Then all you need to do is converting from the original encoding to
your target encoding.
See also a nice introduction into the world of encodings by JEGII:
http://blog.grayproductions.net/articles/understanding_m17n