I have a small problem with accentuated characters.
I have setup everything for unicode and no problem so far (I can input
chinese characters and it is displayed correctly)
The only problem appear if I do a find like:
User.find_by_name(‘é’)
This will give in the log:
SELECT * FROM users WHERE (name=‘é’) LIMIT 1
but it gives me the result of: User.find_by_name(‘e’) without the
accent.
If I input the SQL in mysql, I got no problems.
I don’t really understand why I have problems with accentuated
characters as I don’t have any problem with chinese characters…
It looks like that rails is doing the normalize automatically without
calling it explicitely.
I want to search with the accent, without normalization but it returns
me the non-accentuated string.
How to do that??
It looks like that rails is doing the normalize automatically without
calling it explicitely.
I want to search with the accent, without normalization but it returns
me the non-accentuated string.
Interesting… I have never had this problem… specially because the
log says that it is using the é in the sql statement. You could try
to pass the :conditions parameter to the find function just to see:
User.find(:all,:conditions => “name=‘é’”)
And let me know what happend.
When I get the time, I will test the “find_by_name” with postgresql,
and see if I get the same problem.
Hope this helps,
Ildefonso Camargo
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.