Ruby on Rails Tuesday, June 23, 2015

I ask a question in stackoverflow: http://stackoverflow.com/q/30970840/1054800, There is no answer!

After runing rails console, I can execute the following query:

1.9.3-p551 :001 > ActivityObject.where(:title => "kiketurpis integer aliquet")
And I got a unique answer existed in database. But if I enter:

1.9.3-p551 :002 > ActivityObject.where(:title => '第一个纵纹')

(In double quotes there is a Chinese string.) I got all records in table activity_objects, which means I can not use Chinese string in predicate where.

Also, I can directly query this record using the Chinese string under psql:

vish_development=# select * from activity_objects where title = '第一个纵纹';

So my question is that what should I do for enabling CJK string in ActiveRecord's where or like this?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0c9bfce6-49a8-4df8-a036-67acf1050f1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment