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 -- Posted via http://www.ruby-forum.com/.
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 On 4/11/06, David Reynolds <dr-groups@fantast.com> 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? > TIA. > > David > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060411/926c26bf/attachment.html
David Reynolds
2006-Apr-11 15:46 UTC
[Rails] Re: Does Rails provide solid support for UTF-8?
Nicolas Buet 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? -- Posted via http://www.ruby-forum.com/.
Kevin Skoglund
2006-Apr-11 16:09 UTC
[Rails] Re: Does Rails provide solid support for UTF-8?
Here''s how I handle it, your mileage may vary. Put this in ApplicationController: before_filter :set_charset private def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" end Put this in the <head> of your layout: <meta http-equiv="content-type" content="text/html; charset=utf-8" /> And then make sure that your database is set up for UTF-8. HTH, Kevin Skoglund
David Reynolds 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. -- Posted via http://www.ruby-forum.com/.
Pete Yandell
2006-Apr-11 23:31 UTC
[Rails] Re: Does Rails provide solid support for UTF-8?
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 Yandell http://9cays.com On 12/04/2006, at 1:46 AM, David Reynolds wrote:> Nicolas Buet 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? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
David Reynolds
2006-Apr-12 12:42 UTC
[Rails] Re: Re: Does Rails provide solid support for UTF-8?
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 -- Posted via http://www.ruby-forum.com/.
Pete Yandell
2006-Apr-12 23:07 UTC
[Rails] Re: Re: Does Rails provide solid support for UTF-8?
http://redhanded.hobix.com/inspect/futurismUnicodeInRuby.html On 12/04/2006, at 10:42 PM, David Reynolds wrote:> 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 > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
David Reynolds
2006-Apr-13 23:29 UTC
[Rails] Re: Re: Re: Does Rails provide solid support for UTF-8?
Pete Yandell wrote:> http://redhanded.hobix.com/inspect/futurismUnicodeInRuby.htmlThanks, Pete! I''m definitely looking forward to 2.0, but it seems 1.8.x will do the trick for now. -- Posted via http://www.ruby-forum.com/.