Before I begin, I would like to highlight the structure of what I am working with.
<meta content="text/html;charset=utf-8" http-equiv="content-type"/>
. Hence it is utf-8Content-Type: application/x-www-form-urlencoded; charset=UTF-8
These are the symptoms. I tried everything Google told me and I still have the problem. Does anyone have a clue what it could be? If you need any specific code snippet, tell me so and I'll try to paste it.
The Response Header from the AJAX Handler
Date: Mon, 09 Nov 2009 11:40:27 GMT
Server: Apache/2.2.10 (Linux/SUSE)
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset="utf-8"
200 OK
With the help of you folks and this page, I was able to track down the problem. Seems like the problem was not the encoding by itself, but rather Perl encoding my variable $text twice as utf-8 (according to the site). The solution was as simple as adding Encode::decode_utf8().
I was searching in the completely wrong place to begin with. I thank you all who helped me search in the right place :)
#spreads some upvote love#
returns the following: &38;&65;&116;&105;&108;&100;&101;&59;&38;&112;&97;&114;&97;&59;...
That's:
öäü
Which says your AJAX handler is using an HTML-entity-encoding function for its output, that is assuming input from the ISO-8859-1 character set. You could use a character-reference encoder that knew about UTF-8 instead, but probably it will be easier just to encode the potentially-special characters <>&"'
and no others.
The Request has following header Content-Type: application/x-www-form-urlencoded; charset=UTF-8
There is no such parameter as charset
for the MIME type application/x-www-form-urlencoded
. This will be ignored. Form-encoded strings are inherently byte-based; it is up to the application to decide what character set they are treated as (if any; maybe the application does just want bytes).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With