In a webapp I place a <div id="xxx" contentEditable=true >
for editing purpose. The encodeURIComponent(xxx.innerHTML)
will be send via Ajax POST
type to a server, where a PHP script creates a simple txt file from it which in turn can be downloaded from the user to store it locally or print it on screen. It works perfect so far, but … Yes, but, character encoding is a mess. All special characters like the german Ä
are interpretated wrong. In this case as ä
I google for some days and I study PHP methods like iconv()
and I know how to set up a browsers character encoding and also set a text editor for a correct correspondending decoding. But nothing helps, its still a messs, or becoming even weired.
So my question is : Where in this encoding/decoding roundtrip from the browser to a server and back to the browser I have to do what, to ensure that an Ä
will still be an Ä
?