# Problems with iso 8859-9 chars

**URL:** <https://www.ruby-forum.com/t/problems-with-iso-8859-9-chars/49881>\
**Category:** Rails\
**Created:** [December 9, 2005, 5:10pm UTC](https://www.ruby-forum.com/t/problems-with-iso-8859-9-chars/49881 "2005-12-09T17:10:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Serbulent\_UNSAL](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Serbulent\_UNSAL](https://www.ruby-forum.com/u/Serbulent_UNSAL)\
**Post date:** [December 9, 2005, 5:10pm UTC](https://www.ruby-forum.com/t/problems-with-iso-8859-9-chars/49881/1 "2005-12-09T17:10:33Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![Serbulent\_UNSAL](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Serbulent\_UNSAL](https://www.ruby-forum.com/u/Serbulent_UNSAL)\
**Post date:** [December 9, 2005, 5:22pm UTC](https://www.ruby-forum.com/t/problems-with-iso-8859-9-chars/49881/2 "2005-12-09T17:22:07Z")

</div>

On 12/9/05, Serbulent UNSAL [removed\_email\_address@domain.invalid](mailto: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](http://techno-weenie.net)

---

<div class="post-metadata">

**Author:** ![Serbulent\_UNSAL](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Serbulent\_UNSAL](https://www.ruby-forum.com/u/Serbulent_UNSAL)\
**Post date:** [December 9, 2005, 6:11pm UTC](https://www.ruby-forum.com/t/problems-with-iso-8859-9-chars/49881/3 "2005-12-09T18:11:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Serbulent\_UNSAL](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Serbulent\_UNSAL](https://www.ruby-forum.com/u/Serbulent_UNSAL)\
**Post date:** [December 9, 2005, 7:14pm UTC](https://www.ruby-forum.com/t/problems-with-iso-8859-9-chars/49881/4 "2005-12-09T19:14:17Z")

</div>

On 12/9/05, Rick O. [removed\_email\_address@domain.invalid](mailto: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

---

<div class="post-metadata">

**Author:** ![Serbulent\_UNSAL](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Serbulent\_UNSAL](https://www.ruby-forum.com/u/Serbulent_UNSAL)\
**Post date:** [December 9, 2005, 6:19pm UTC](https://www.ruby-forum.com/t/problems-with-iso-8859-9-chars/49881/5 "2005-12-09T18:19:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Serbulent\_UNSAL](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Serbulent\_UNSAL](https://www.ruby-forum.com/u/Serbulent_UNSAL)\
**Post date:** [December 10, 2005, 10:43am UTC](https://www.ruby-forum.com/t/problems-with-iso-8859-9-chars/49881/6 "2005-12-10T10:43:24Z")

</div>

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](http://techno-weenie.net)
