Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Character encoding: UTF-8 to ISO-*


lucy24 - 10:39 am on Feb 17, 2012 (gmt 0)


Hm. Can you change a text string's encoding in JavaScript? You'd have to tell it, in effect, "I'm giving you this UTF-8-encoded text. Now you have to re-encode it as 8859-15, convert that into percent-encoding, ship it off to this other site-- and then reverse the process with whatever they send back." Or does the percent-encoding happen en route after you have shipped off your word?

It's all done with two mouse clicks in my text editor-- one to pick the encoding, one to say whether I want to convert or reinterpret-- but I haven't a clue how to do it in javascript. It's not a straight conversion, like switching from decimal to hexadecimal. The letters are simply in different places.

Now that you mention it: when I was hovering on the links before, I was in ISO-Latin-1. Now that I'm in UTF-8 I see... well, at least three different forms. Nos. 1 and 3 end in %FC, No. 4 is the word with its proper u-umlaut, and and No. 2 is the unicode "I can't deal with this" character-- the same one that now displays in the text fields of the first three posts in this thread :)

I think we are dealing with three different encodings. I think it would be better if I cleaned the rat cage-- which I should have done several hours ago-- and maybe in the meantime someone who speaks fluent Javascript will stop by and shed light.


Thread source:: http://www.webmasterworld.com/javascript/4418272.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com