I do not know PHP, but I think there is something wrong at that side. Apparently setting the HTTP header to utf-8 plus wishful thinking does not change the applied output encoding of PHP. Besides, if you do not deliver HTML you should also use the correct MIME type text/plain.
Motörhead is 9 characters. Your reported content length is also 9 bytes, while the ö Umlaut should be encoded into at least 2 bytes.
Try the snippet below, an alternative is to ensure that your PHP source document is already utf-8 encoded.
header("Content-Type: text/plain; charset=utf-8");
thanks for the hint.
This does the trick:
in the php script the utf8 econded string must be published url encoded, otherwise in would be utf8 interpreted twice from the receiving ExtendScrip
and then in the ExtendScript decode the content, e.g.
The second wrapper should not be required if your web site is supposed to deliver UTF8.
Instead you'd add a conversion step within ExtendScript.
E.g. use one of the JS UTF8 decoders from the web, or write the raw bytes out into a file then adjust the File.encoding variable for re-reading.
Ah, I always forget that Socket also has its own .encoding variable. Just make sure it is set correctly.