Web Hosting Talk







View Full Version : I have a problem with JS HTML encoding


eugene2006
10-16-2006, 12:21 PM
I have a problem with JS HTML encoding
When I use non latin characters in window.alert() I get nonsense
If I use it in document html like ᄋ 弫 ᄋ ᄋ and so on then it is shown ok but when I put the same code encoding into the alert() box I get these ᄋ 弫 ᄋ ᄋ but not non latin text
How to fix it? What are the possibilities?

01globalnet
10-16-2006, 08:53 PM
As long as you have valid encoding in your HTML file, everything is fine.

So, if you want to alert let's say greek characters use

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-7" />


and all texts will appear correctly. Most times however you will be fine with utf.

eugene2006
10-16-2006, 08:56 PM
but window.alert() shows just numbers not non latin