|
Didn't think it would work - the character entities seem to get resolved as the page is rendered, and once that has happened, then nothing can get them back!!!
Microsoft were useless - they couldn't even be arsed to acknowledge the emails I had sent! Just completely ignored me.
However, having thought a little further ahead, I came up with a neat solution to that problem and a related one....
(Incidentally, the reason that I wanted to use character entities in this way is that I was writing a popup panel for my CMS content editor which would let users enter foreign characters and sybols, in a similar way to Windows Character Map.)
Rather than worry about inserting the correct HTML character entities at the point at which they are clicked on in the character map, I am letting the foreign characters go straight through, and I then process the entire HTML page later.
My conversion function works by using a hardcoded associative array (created by using expando properties), and then looping through each foreign character/symbol in the array, replacing each instance of it in the HTML page with the corresponding character entity.
This means that if users enter foreign characters directly into my content editor WITHOUT using my character map (perhaps using a foreign keyboard, or Windows Character Map), then these characters are caught and converted! Thus, no foreign character or symbol survives intact - by the time it reaches the DB for storage, they've all been converted.
I run this filter on the HTML code when the content editor loads, when it saves & closes, and when the user switches to HTML code view (from WYSIWYG mode).
So, in the end the .innerHTML property behaving badly didn't matter, but I would STILL like to know if it is possible to get those character entities back without having to use a lookup table...!
If this explanation isn't clear (I'm in a hurry at the moment), then please say so and I'll elaborate!
Thanks to everyone that tried to help, but it seems that we have been defeated by Microsoft's poor programming yet again!
|
|