crowdint / rails3-jquery-autocomplete

An easy and unobtrusive way to use jQuery's autocomplete with Rails 3

Home Page:http://rubygems.org/gems/rails3-jquery-autocomplete

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with cyrillic symbols

greyrain opened this issue · comments

I installed the rails3-jquery-autocomplete and everything works well.
But when I enter сyrillic characters, I see encoding problem:

JSON:
[{"id":"16","label":"\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd","value":"\ufffd\ufffd\ufffd\uff......"}]

The page encoding is UTF8. Mysql and Rails configs are set to UTF8.
ruby 1.9.2
rails 3.1.1

Please, help, how to use encoding, or what must i do.

I used this code, but it did not help:

autocomplete :country, :name do |items|
CustomJSON::Encoder.encode(items)
end

Issue solved!

Real problem was with the mysql encoding.
I understand it, when i run in console: Country.all

If I use the pgsql there are no problems with cyrillic symbols, when I run command Country.all and when I use rails3-jquery-autocomplete.

Best regards.