aspose file tools*
The moose likes Ruby and the fly likes Ruby in practice question: Do UTF-8 and Ruby fit well in practice? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Ruby in practice question: Do UTF-8 and Ruby fit well in practice?" Watch "Ruby in practice question: Do UTF-8 and Ruby fit well in practice?" New topic
Author

Ruby in practice question: Do UTF-8 and Ruby fit well in practice?

Dragan Stankovic
Ranch Hand

Joined: Oct 14, 2008
Posts: 33
Have you done any project using Ruby language that required UTF-8 support and do you think that Ruby lacks internationalization support?


http://www.expertaya.com
Assaf Arkin
Author
Greenhorn

Joined: Feb 09, 2009
Posts: 16
For internationalization, there are several libraries to choose from. The one I'm most familiar with is [url=http://github.com/mattetti/i18n]i18n[/url], which I use as part of Rails.
Jeremy McAnally
Author
Greenhorn

Joined: Feb 09, 2009
Posts: 19
Ruby 1.9 includes some internationalization features, and Rails has recently added a LOT of great internationalization features.
Dragan Stankovic
Ranch Hand

Joined: Oct 14, 2008
Posts: 33
Thanks.

My first project in ruby was simple site scraper using hpricot. Code sample that I tried to use seemed simple and straightforward. And then, because I tried to scrap a cyrillic site I run into problems which I couldn't solve. Xml parser started to throw errors, converting characters with iconv didn't work (or at least I couldn't make it work). So I gave up of doing this with ruby. I made that scraper in a matter of minutes using HtmlUnit (Java library)..

I'll give ruby another chance as soon as I have more time, but I was curious if the problem was with my lack of experience with ruby or (as I read at several forums) bad internationalization support in ruby. Anyway, as you pointed it out, it seems that they fixed the problems they had with earlier ruby versions so we'll see.
Assaf Arkin
Author
Greenhorn

Joined: Feb 09, 2009
Posts: 16
You might need to set $KCODE = 'U' in your script to tell Ruby to use UTF-8 by default.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ruby in practice question: Do UTF-8 and Ruby fit well in practice?