Reading from the HTML DOM returns UTF-8 characters
- by teehoo
I have a contenteditable div where I'm reading individual characters and sending them off to a server (for more background this is similar to Google Wave where typing a character automatically sends it)
I was using a plain old html textfield before and everything worked fine until I "upgraded" to a contenteditable div.
My problem is that now the characters are in UTF-8 format, which is causing some weird problems on the server that I would rather not debug. It would be much easier to force everything to be ASCII on the client side.
Is there any way to do this? I tried putting in a meta tag stating the html file is charset=ISO-8859-1, but it doesnt seem to work. Reading from the div tag still returns UTF-8 codes. (One example is when I press space I get the pair 0xC2 0xA0 which corresponds to a "non-breaking white space"