# Unicode not working under Mongrel

**URL:** <https://www.ruby-forum.com/t/unicode-not-working-under-mongrel/88280>\
**Category:** Rails\
**Created:** [March 9, 2007, 11:31am UTC](https://www.ruby-forum.com/t/unicode-not-working-under-mongrel/88280 "2007-03-09T11:31:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [March 9, 2007, 11:31am UTC](https://www.ruby-forum.com/t/unicode-not-working-under-mongrel/88280/1 "2007-03-09T11:31:57Z")

</div>

hi!

I started my app in mongrel and everything works fine, except that it  
doesn’t show the unicode chars right. it worked under WEBrick… where  
should I start tackling the problem?  
thank you!

david

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [March 9, 2007, 1:06pm UTC](https://www.ruby-forum.com/t/unicode-not-working-under-mongrel/88280/2 "2007-03-09T13:06:51Z")

</div>

It’s possible mongrel is not including the charset in the HTTP header  
while WEBrick is. In my testing both show unicode chars fine, so you  
might want to embed a charset as a meta tag in your app:

```
 <meta http-equiv="Content-Type" content="text/html;

```

charset=utf-8" /\>

This’ll force whatever browser to use utf-8 regardless of what’s in  
the header.

On Mar 9, 6:31 pm, “D. Krmpotic” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [March 9, 2007, 10:47pm UTC](https://www.ruby-forum.com/t/unicode-not-working-under-mongrel/88280/3 "2007-03-09T22:47:24Z")

</div>

Yes. You nailed it! I’m very thankful for your help…  
Something else interests me… is that more or less all that one has to  
do to get a full UTF support in Rails (=do nothing)… or do I have to  
use something like Globalize plugin to be able to show and store utf  
data). Thank you!

DAvid

Is Globalize plugin used for UTF support or just for localization?  
If I only want to have the possibility of storing

Eden Li wrote:

> It’s possible mongrel is not including the charset in the HTTP header  
> while WEBrick is. In my testing both show unicode chars fine, so you  
> might want to embed a charset as a meta tag in your app:
> 
> ```
> <meta http-equiv="Content-Type" content="text/html;
> 
> ```
> 
> charset=utf-8" /\>
> 
> This’ll force whatever browser to use utf-8 regardless of what’s in  
> the header.
> 
> On Mar 9, 6:31 pm, “D. Krmpotic” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [March 10, 2007, 4:10am UTC](https://www.ruby-forum.com/t/unicode-not-working-under-mongrel/88280/4 "2007-03-10T04:10:49Z")

</div>

On the client side, that should be enough. All the browsers I’ve  
tested are good about sending data as utf-8.

On the Rails/database side, you’ll need to make sure your database is  
storing stuff as utf-8. There are a number of resources out there  
that detail what needs to be done. This link [1] is good if you’re on  
MySQL.

[1]  
[http://ruphus.com/blog/2005/06/23/getting-unicode-mysql-and-rails-to-cooperate/](http://ruphus.com/blog/2005/06/23/getting-unicode-mysql-and-rails-to-cooperate/)

On Mar 10, 5:47 am, “D. Krmpotic” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
