user471317
user471317

Reputation: 1231

French characters to html entities

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

Answers (1)

stewe
stewe

Reputation: 42644

You could use this htmlentities() function. And then encodeURIComponent on the result.

Demo: http://jsfiddle.net/Rf2rE/

Upvotes: 2

Related Questions