# Language issue in console

**URL:** <https://www.ruby-forum.com/t/language-issue-in-console/182444>\
**Category:** Rails I18n\
**Created:** [January 28, 2010, 7:30am UTC](https://www.ruby-forum.com/t/language-issue-in-console/182444 "2010-01-28T07:30:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![toddf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@toddf](https://www.ruby-forum.com/u/toddf)\
**Post date:** [January 28, 2010, 7:30am UTC](https://www.ruby-forum.com/t/language-issue-in-console/182444/1 "2010-01-28T07:30:20Z")

</div>

Hi,

We’re trying to search our database in Thai, but it seems the ruby  
console doesn’t recognise the characters.

Can someone shead some light on this please?

Some text input would be “à¸à¸£à¸¸à¸‡à¹€à¸—à¸žà¸¯”

And the console will show

Processing ProductsController#getprovinces (for 192.168.150.1 at  
2010-01-28 00:54:40) [GET]  
Parameters: {“code”=\>“Ã Â¸Ã Â¸Â£Ã Â¸Â¸Ã Â¸Ã Â¹Ã Â¸Ã Â¸Ã Â¸Â¯”}  
Province Load (0.6ms) SELECT \* FROM `provinces` WHERE (name like  
‘%Ã Â¸Ã Â¸Â£Ã Â¸Â¸Ã Â¸Ã Â¹Ã Â¸Ã Â¸Ã Â¸Â¯%’) ORDER BY name ASC LIMIT 10  
Completed in 10ms (View: 3, DB: 1) | 200 OK [[http://gearbox/products/](http://gearbox/products/)  
getprovinces/?code=  
%E0%B8%81%E0%B8%A3%E0%B8%B8%E0%B8%87%E0%B9%80%E0%B8%97%E0%B8%9E  
%E0%B8%AF]

It doesnt seem to recognise the thai characters.

I’ve installed a Thai language pack on our server (ubuntu) but i’m  
unsure where to turn from here.

Is it the charset in the html? do we need to pass some data to ruby to  
tell it that there’s thai coming?

Any help would be appreciated.

Thanks  
Todd

---

<div class="post-metadata">

**Author:** ![toddf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@toddf](https://www.ruby-forum.com/u/toddf)\
**Post date:** [January 28, 2010, 7:37am UTC](https://www.ruby-forum.com/t/language-issue-in-console/182444/2 "2010-01-28T07:37:21Z")

</div>

Is your DB setup to use UTF-8 , I’m searching in Thai and Lao without an  
issue  
When you say the ruby console , what do you mean ? irb - script/console  
?

Justin

---

<div class="post-metadata">

**Author:** ![toddf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@toddf](https://www.ruby-forum.com/u/toddf)\
**Post date:** [January 28, 2010, 7:43am UTC](https://www.ruby-forum.com/t/language-issue-in-console/182444/3 "2010-01-28T07:43:48Z")

</div>

On Thu, Jan 28, 2010 at 04:46, foxxx [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> We’re trying to search our database in Thai, but it seems the ruby  
> console doesn’t recognise the characters.
> 
> Can someone shead some light on this please?

I don’t get exactly what issue you’re describing, but this may apply:  
[http://henrik.nyh.se/2008/03/irb-readline](http://henrik.nyh.se/2008/03/irb-readline)
