Forum: Rails I18n language issue in console

72084b8576fa49305c7f858ca29d0b24?d=identicon&s=25 Todd Fox (foxxx)
on 2010-01-28 07:30
(Received via mailing list)
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/
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
Ad80ef30dd1243ebc48f4de359fb01ce?d=identicon&s=25 Justin MacCarthy (Guest)
on 2010-01-28 07:37
(Received via mailing list)
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
4a551074ddba4460f95d011c47190d0e?d=identicon&s=25 Henrik --- (malesca)
on 2010-01-28 07:43
(Received via mailing list)
On Thu, Jan 28, 2010 at 04:46, foxxx <todd@vexill.com> 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
This topic is locked and can not be replied to.