Reputation: 1231
I am passing some French characters in an ajax call to our database. They are expecting É to be passed as %26Eacute%3B
, é to be passed as %26eacute%3B
, etc. How can I do this in javascript?
Thanks.
Upvotes: 0
Views: 644
Reputation: 42644
You could use this htmlentities() function. And then encodeURIComponent on the result.
Demo: http://jsfiddle.net/Rf2rE/
Upvotes: 2