Forum: Ruby on Rails Problems with iso 8859-9 chars

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Serbulent UNSAL (Guest)
on 2005-12-09 18:10
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.
technoweenie (Guest)
on 2005-12-09 18:22
(Received via mailing list)
On 12/9/05, Serbulent UNSAL <removed_email_address@domain.invalid> wrote:
> 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
jiayun (Guest)
on 2005-12-09 19:11
(Received via mailing list)
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.
jiayun (Guest)
on 2005-12-09 19:19
(Received via mailing list)
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.
mariano.kamp (Guest)
on 2005-12-09 20:14
(Received via mailing list)
On 12/9/05, Rick O. <removed_email_address@domain.invalid> wrote:
> > charset=windows-1254">
>
> 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
Serbulent UNSAL <> (Guest)
on 2005-12-10 11:43
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
This topic is locked and can not be replied to.