Accent incorrectly displayed in ISO-8859-1 on Firefox with window.open

Viewed 136

In our application encoded in ISO-8859-1, I have javascript code that opens a window with the window.open command to display values with accents.

These accented values are not displayed correctly (for é I get é). They are passed as a parameter in the URL of the window.

http://<SERVER>:<PORT>/<TOMCAT-CAR>/pages/script.jsp?prenom=Prénom

This problem only occurs on Firefox (under IE and Chrome the character is displayed correctly).

Do you know why there is this difference?

1 Answers

Before passing the string, encode it first using encodeURI(), and when you fetch the result decode it before using it using decodeURI().

Related