Via POST, I send a string "中文" to php.
Using file_get_contents("php://input") gets "%E4%B8%AD%E6%96%87".
Using $_POST["data"] gets "??".
Why?
PHP encoding failure.
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: PHP encoding failure.
Not really sure in all honesty. As a practical measure it might be worth investigating if mb_convert_encoding() can help.
Can you tell us what sort of encoding is used to create those characters in the first place?
Can you tell us what sort of encoding is used to create those characters in the first place?
Re: PHP encoding failure.
uft-8 through textarea, sent using XHR.
Re: PHP encoding failure.
Fixed. I just re-installed the system. And everything works fine.