Hi, I am using ruby 1.8 and mysql 5. My tables charset is latin1 and i use some turkish chars. When i am using RoR on Webrick chars seems like ???? if i change character encoding from browser to windows-1254 or iso-8859-9 it is ok but it comes to me default as utf8. So i use <meta http-equiv="Content-Type" content="text/html; charset=windows-1254"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9"> in layout files in my project but there is no affect. How can i change default charset of webrick utf8 to iso-8859-9. Ps: i try to convert my table utf8 form latin1 but there is no affect in my application. Thanks for all answers. -- Posted via http://www.ruby-forum.com/.
On 12/9/05, Serbulent UNSAL <aliabone-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am using ruby 1.8 and mysql 5. My tables charset is latin1 and i use > some turkish chars. When i am using RoR on Webrick chars seems like ???? > if i change character encoding from browser to windows-1254 or > iso-8859-9 it is ok but it comes to me default as utf8. So i use > > <meta http-equiv="Content-Type" content="text/html; > charset=windows-1254"> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-9"> > > in layout files in my project but there is no affect. How can i change > default charset of webrick utf8 to iso-8859-9. > > Ps: i try to convert my table utf8 form latin1 but there is no affect in > my application. > > Thanks for all answers.try this in your controller: headers[''Content-Type''] = ''text/html; charset=iso-8859-9'' -- rick http://techno-weenie.net
Are you using Rails 0.14.4? I found that Rails 0.14.4 doesn''t access mysql in correct encoding, but Rails 0.14.3 does not have this problem. I don''t know if this is a bug or we should have to install mysql-ruby and set "encoding: UTF8" in database.yml.
Sorry, it seems that we encountered different problems. My problem is that I have utf8 tables, but Rails 0.14.4 doesn''t retrieve and write data in utf8 encoding. On 12/10/05, JiaYun <jiayun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Are you using Rails 0.14.4? > > I found that Rails 0.14.4 doesn''t access mysql in correct encoding, > but Rails 0.14.3 does not have this problem. > > I don''t know if this is a bug or we should have to install mysql-ruby > and set "encoding: UTF8" in database.yml. >
On 12/9/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 12/9/05, Serbulent UNSAL <aliabone-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > > I am using ruby 1.8 and mysql 5. My tables charset is latin1 and i use > > some turkish chars. When i am using RoR on Webrick chars seems like ???? > > if i change character encoding from browser to windows-1254 or > > iso-8859-9 it is ok but it comes to me default as utf8. So i use > > > > <meta http-equiv="Content-Type" content="text/html; > > charset=windows-1254"> > > <meta http-equiv="Content-Type" content="text/html; > > charset=iso-8859-9"> > > > > in layout files in my project but there is no affect. How can i change > > default charset of webrick utf8 to iso-8859-9. > > > > Ps: i try to convert my table utf8 form latin1 but there is no affect in > > my application. > > > > Thanks for all answers. > > try this in your controller: > > headers[''Content-Type''] = ''text/html; charset=iso-8859-9''Is there no default way to specify the coding? I am now working around this by using a before filter, but I guess that there is an easier way to do this, isn''t there? I fgrep''ed my project directory for encoding, but nothing came up. Cheers, Mariano _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi İ write the code to my application.rb but i take the error undefined local variable or method `headers'' for ApplicationController:Class Serbulent technoweenie wrote:> > try this in your controller: > > headers[''Content-Type''] = ''text/html; charset=iso-8859-9'' > > > -- > rick > http://techno-weenie.net-- Posted via http://www.ruby-forum.com/.