This project is archived and is in readonly mode.
mail_to :javascript should use decodeURIComponent instead unescape
-
Marc-André Lafortune
Oups, managed to screw up my very first ticket... The example should read:
mail_to "xxx@example.com", "Écris-nous", :encode=>:javascriptand the temporary fix:
mail_to "xxx@example.com", "Écris-nous".to_json[1..-2], :encode=>:javascript -
Emilio Tagua
- Title changed from mail_to :javascript screws up unicode to mail_to :javascript should use decodeURIComponent instead unescape
- Tag set to actionpack, helper, patch
Instead of using unescape to decode the generated string, Rails should use decodeURIComponent since it is utf-8 friendly.
I attach the patch and test, i have also tested in browsers that the escaped javascript is the expected.
-
Michael Koziarski
- State changed from new to committed
