I'm using Rails 3.0.3 with REE ( Ruby 1.8.7 ) and gem 'mysql2', '0.2.6'
There's a search feature in my project that enable people to use the GET method using URL or using forms and then generate the URL.
Example:
I want to search:
origin city: "Århus, Denmark" and destination city: "Asunción, Paraguay"
they both have a special character: "Å" and "ó", so the URL will be generated like this when someone click the search button.
?&origin=%C5rhus%2C%20Denmark&destination=Asunci%F3n%2C%20Paraguay
Problem:
When i search that city, it's not unescaped like i want ( i tried using like CGI, URI, even some gems).
When i see at the console, ActiveRecord received the query like this:
Parameters: {"destination"=>"Asunci�n, Paraguay", "origin"=>"�rhus, Denmark", "sort"=>"newest"}
City Load (0.1ms) SELECT `cities`.* FROM `cities` WHERE (`cities`.`name` = '�rhus') ORDER BY cities.name ASC
City Load (6.8ms) SELECT `cities`.* FROM `cities` WHERE (`cities`.`name` = 'Asunci�n, Paraguay') ORDER BY cities.name ASC
Conclusion: the cities can't be found :(
But, i found an interesting thing:
When i made an error on the file asociated with this function, the output will be like this :
Request
Parameters: {"destination"=>"Asunción, Paraguay", "origin"=>"Århus, Denmark", "sort"=>"newest"}
it's a valid one!
Question:
Do you guys have an idea how to solve this? Thanks in advance :)