Home >Backend Development >PHP Tutorial >phped debugger debugging, the solution to display garbled characters when the variable value is Chinese_PHP Tutorial
There is the following php code to be debugged:
In the debug analyzer, the garbled characters are displayed as follows:
After exploring all aspects, we found the solution as follows:
You need to set up the debugger encoding separately. There are global settings and personalized settings for each project,
Generally, for global settings, we set it to utf-8 format, as shown in the figure below:
However, this encoding format must be consistent with the specific project encoding format, otherwise the Chinese value will be garbled.
If your project is in "gbk" encoding format, you need to additionally set the debugger for this project to gbk encoding. The operation is as follows:
1>. Right-click the project --> Select "Properties":
2>.Select the "Debugger" tab and set the encoding format as follows:
Note, if your project encoding is "utf-8", select "utf-8" here, if it is "gbk", then select "gbk".
Start debugging again, and the normal display variable value is in Chinese, as shown in the figure below:
Excerpted from Qian Tuwuliang’s blog