Does Rails provide solid support for UTF-8?

I need to use UTF-8 in my app and was wondering if Rails would support
it properly.
Some sites seem to be saying that it has weak internationalization
support. Is this true? If so, where is the problem? What should I look
out for?
Are there tweaks, plugins or gems that fix the problem?
TIA.

David

Hi,

my app is utf-8, and i have no problem. There’s a tuto somewhere that
explains how to do that. The only issue was with pdf-writer, which (when
i
made the application) did not support utf-8 (but i found a workaround).

Small warning: be very careful that your editor, as well as the editor
of
anyone touching your app, is encoding files in utf-8

Nicolas B. wrote:

Hi,

my app is utf-8, and i have no problem. There’s a tuto somewhere that
explains how to do that. The only issue was with pdf-writer, which (when
i
made the application) did not support utf-8 (but i found a workaround).

Thanks, Nicolas!
If you happen to remember the tuto and workaround for the pdf-writer,
let me know. TIA.
BTW, I’m planning to set up the following:

  • OS: FreeBSD
  • Web server: Lighttpd
  • DB: MySQL
  • Misc: Sessions stored in DB

Any known UTF-8 problems with that?

David R. wrote:

I need to use UTF-8 in my app and was wondering if Rails would support
it properly.
Some sites seem to be saying that it has weak internationalization
support. Is this true? If so, where is the problem? What should I look
out for?
Are there tweaks, plugins or gems that fix the problem?

AFAIK, Ruby’s string functions doesn’t support utf-8.
And I presume that weak internationalization support mean “RoR doesn’t
provide an unified internationalization solution”, you need to rely on
third party code which is certainly a problem.

http://wiki.rubyonrails.com/rails/pages/HowToUseUnicodeStrings

The nasty warnings at the top of that page are too strong. Our app is
using UTF-8 in Rails extensively and we’re having no problems at all,
even with a bunch of Japanese users. You’ve just got to be a little
careful given that Ruby 1.8.* doesn’t have much unicode support in
its built-in string handling.

Pete Y.
http://9cays.com

Pete,

Thanks a lot for the link and encouraging news re your own experience
using UTF-8!

BTW, the page says “This is being looked at” (i.e., they are looking
into how to fix the problem w/ Ruby not handling UTF-8 properly), but
does anyone happen to know if there are any concrete plans to
incorporate thorough support for Unicode in Ruby?

David

Pete Y. wrote:

http://redhanded.hobix.com/inspect/futurismUnicodeInRuby.html

Thanks, Pete! I’m definitely looking forward to 2.0, but it seems 1.8.x
will do the trick for now.

http://redhanded.hobix.com/inspect/futurismUnicodeInRuby.html