Hi, I currently have a site that lets people enter info and submit it to the database. But the problem is the it lets people enter data in their language (portuguese and spanish) and all the special characters for those languages get replaced by symbols. Any idea how would I fix that? Thanks a lot. -- Posted via http://www.ruby-forum.com/.
This is kinda urgent, please. Hi, I currently have a site that lets people enter info and submit it to the database. But the problem is the it lets people enter data in their language (portuguese and spanish) and all the special characters for those languages get replaced by symbols. Any idea how would I fix that? Thanks a lot. -- Posted via http://www.ruby-forum.com/.
Francois Beausoleil
2006-Mar-10 06:20 UTC
[Rails] Problem saving data in different languages
2006/3/9, John <joaobatista@aol.com>:> Hi, I currently have a site that lets people enter info and submit it to > the database. But the problem is the it lets people enter data in their > language (portuguese and spanish) and all the special characters for > those languages get replaced by symbols. Any idea how would I fix that?That partially depends on your database backend and some other things. Please see the How To Use Unicode Strings on the Rails Wiki: http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings In my case, I use Windows and only have the bit in config/database.yml and a before_filter set in ApplicationController that sets my Content-Type to "application/xhtml+xml; charset=UTF-8". Works fine for me. YMMV. My physical view files are also UTF-8 encoded. Rails simply copies bucket-o-bits around, and feels fine with it. Bye ! -- Fran?ois Beausoleil http://blog.teksol.info/
anu_spam-lists@yahoo.com
2006-Mar-10 06:39 UTC
[Rails] SaltedHash Login generator problem...
A newbie question: I have configured the action mailed properly with correct smtp server, domain, login, password and port. Yet I cannot the system cannot sendout the emails, is there a log setting that I can enable to see the failure logs for ActionMailer? I do see in the development.log file that a template email that was suppose to be sent out was printed with working link to confirm the account creation. But no actual email gets sent out.. I have been trying to get this to work for a while with no luck. Anu ----- Original Message ---- From: Francois Beausoleil <francois.beausoleil@gmail.com> To: rails@lists.rubyonrails.org Sent: Thursday, March 9, 2006 10:20:25 PM Subject: Re: [Rails] Problem saving data in different languages 2006/3/9, John <joaobatista@aol.com>:> Hi, I currently have a site that lets people enter info and submit it to > the database. But the problem is the it lets people enter data in their > language (portuguese and spanish) and all the special characters for > those languages get replaced by symbols. Any idea how would I fix that?That partially depends on your database backend and some other things. Please see the How To Use Unicode Strings on the Rails Wiki: http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings In my case, I use Windows and only have the bit in config/database.yml and a before_filter set in ApplicationController that sets my Content-Type to "application/xhtml+xml; charset=UTF-8". Works fine for me. YMMV. My physical view files are also UTF-8 encoded. Rails simply copies bucket-o-bits around, and feels fine with it. Bye ! -- Fran?ois Beausoleil http://blog.teksol.info/ _______________________________________________ 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/20060310/4a47ad92/attachment.html
Thanks a lot, that worked. Fran?ois Beausoleil wrote:> 2006/3/9, John <joaobatista@aol.com>: >> Hi, I currently have a site that lets people enter info and submit it to >> the database. But the problem is the it lets people enter data in their >> language (portuguese and spanish) and all the special characters for >> those languages get replaced by symbols. Any idea how would I fix that? > > That partially depends on your database backend and some other things. > Please see the How To Use Unicode Strings on the Rails Wiki: > > http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings > > In my case, I use Windows and only have the bit in config/database.yml > and a before_filter set in ApplicationController that sets my > Content-Type to "application/xhtml+xml; charset=UTF-8". Works fine > for me. YMMV. My physical view files are also UTF-8 encoded. Rails > simply copies bucket-o-bits around, and feels fine with it. > > Bye !-- Posted via http://www.ruby-forum.com/.
David Johnson
2006-Mar-10 12:33 UTC
[Rails] Urgent: Problem saving data in different languages
Use UTF-8 for everything. I''m a ruby-newbie myself, so the details are still fuzzy. Perhaps JRuby is mature enough to try? On Fri, 2006-03-10 at 06:44 +0100, John wrote:> This is kinda urgent, please. > > Hi, I currently have a site that lets people enter info and submit it to > the database. But the problem is the it lets people enter data in their > language (portuguese and spanish) and all the special characters for > those languages get replaced by symbols. Any idea how would I fix that? > > Thanks a lot. > >
Alex Young
2006-Mar-10 20:36 UTC
[Rails] Urgent: Problem saving data in different languages
John wrote:> This is kinda urgent, please. > > Hi, I currently have a site that lets people enter info and submit it to > the database. But the problem is the it lets people enter data in their > language (portuguese and spanish) and all the special characters for > those languages get replaced by symbols. Any idea how would I fix that?There''s nothing broken, necessarily. Just make sure that whatever''s reading the data out of the database speaks the same character set as the data you''ve got in there, and all should be well, provided that everything''s in the *same* character set. To make sure that your information chain is all using the same character set, you need to: - Set your http headers to the right charset on both standard actions and AJAX responses - Set the character set in the META head tag. If you''ve got a running app that''s got to remain collecting live info, don''t change anything yet until you understand what can be affected by your changes. The absolute last thing you want is a database with more than one character set in it. -- Alex
Edmundo Ruiz
2006-Mar-30 05:01 UTC
[Rails] Re: Urgent: Problem saving data in different languages
It works great on my database, as I can save all the spanish characters like ???????, but when I write static text on rhtml pages themseves, I renders a question mark symbol on the static but the stuff from the database looks fine. I''ve added a few things, including code like... < meta http-equiv="content-type" content="text/html; charset=utf-8" / > ...and... class ApplicationController < ActionController::Base before_filter :set_charset def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" suppress(ActiveRecord::StatementInvalid) do ActiveRecord::Base.connection.execute ''SET NAMES UTF8'' end end end ...and... encoding: utf-8 ...on datbase.yml. Some of these did fix the database problems, at least! -- Posted via http://www.ruby-forum.com/.