# How do i make rails not use utf8

**URL:** <https://www.ruby-forum.com/t/how-do-i-make-rails-not-use-utf8/195521>\
**Category:** Rails\
**Created:** [September 24, 2010, 10:22am UTC](https://www.ruby-forum.com/t/how-do-i-make-rails-not-use-utf8/195521 "2010-09-24T10:22:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [September 24, 2010, 10:22am UTC](https://www.ruby-forum.com/t/how-do-i-make-rails-not-use-utf8/195521/1 "2010-09-24T10:22:05Z")

</div>

I want ror to not use utf8. I have tried setting $KCODE to ‘n’.  
Activercord still tries to convert my special characters to utf.

The character ‘ê’ comes as "\303\252’. I want it to show the ê WITHOUT  
using utf8. I have NO reason to use utf8. I do not know if this is a  
rails or ruby issue. Can someone please help?

Ruby: 1.8.7  
Rails: 2.3.8  
Database: Firebird 2.1.3

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [September 24, 2010, 12:31pm UTC](https://www.ruby-forum.com/t/how-do-i-make-rails-not-use-utf8/195521/2 "2010-09-24T12:31:28Z")

</div>

On Sep 24, 9:21 am, john [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I want ror to not use utf8. I have tried setting $KCODE to ‘n’.  
> Activercord still tries to convert my special characters to utf.
> 
> The character ‘ê’ comes as "\303\252’. I want it to show the ê WITHOUT  
> using utf8. I have NO reason to use utf8. I do not know if this is a  
> rails or ruby issue. Can someone please help?

I’d strongly recommend you reconsider that position - you’ve got to  
use some encoding to encode your text, what encoding do you want to  
use that is ‘better’ than utf-8 ?

There are multiple pieces to the problem:

- response to the user’s browser need to state the correct character  
set (ActionController::Base.default\_charset controls the default  
character set user)
- your database should be set to use correct collation etc (eg a utf8  
string is not sorted in the same way as a latin1 string, some  
sequences of bytes are not valid utf8 etc)
- your data needs to actually be in that encoding: if you have  
existing content you will have to convert it all to this new encoding  
(and depending on your content there might not be a single encoding  
that covers all of them).
- browser shenanigans

To my knowledge, active record itself doesn’t do any conversion  
(beyond in some cases telling the adapter library what character set  
it expects) - you’re probably seeing the browser encode what you type  
as utf-8

Fred
