php5.2.17 json utf8 fail

Asked by Ronel

I tried to deploy ius version php5.2.17 and mysql 5.5 with apache 2.2.3 on a testing server, set everything (apache, mysql php.ini) utf8
however, when I opened my site json_decode can not fully read the script input, never seen on my compiled version.
Is there any chance a bug would cause it?
Please help me resolve it!

Question information

Language:
English Edit question
Status:
Solved
For:
IUS Community Project Edit question
Assignee:
No assignee Edit question
Solved by:
Ronel
Solved:
Last query:
Last reply:
Revision history for this message
Jeffrey Ness (jeffrey-ness) said :
#1

Hello Ronel,

We have not heard of any json bugs regarding PHP 5.2, can you please provide
detailed steps to reproduce the issue.

By being able to reproduce we will also be able to investigate issues.

Thanks
Jeffrey-

Revision history for this message
Ronel (renolteng) said :
#2

Hi Jeffrey,

Sorry for my poor English.

Problems seems to be the utf8 format. When we run scripts like $t = json_decode($this->value);
No return value we could get.

I tried to add header('Content-Type: text/html; charset=utf-8'); to the php script head and the
script result is fine now.

However, nothing like add a default_charset = "utf8" in php.ini worked on that.

Could you please teach me a way to change the encoding globally to utf8?

Best Regards
Ronel Li

Revision history for this message
Ronel (renolteng) said :
#3

Hi Jeffrey,

Solved with

mbstring.internal_encoding=utf-8

mbstring.http_output=UTF-8

mbstring.encoding_translation=On

mbstring.func_overload=6

thx for caring

Ronel

Revision history for this message
Jeffrey Ness (jeffrey-ness) said :
#4

Hello Ronel,

I'm glad to hear you have been able to solve the issue,
thank you for sharing the resolution and continuing to support the
IUS Community Project

Jeffrey