Home > Backend Development > PHP Problem > How to convert PHP utf8 to Chinese

How to convert PHP utf8 to Chinese

藏色散人
Release: 2023-03-01 22:30:01
Original
6869 people have browsed it

How to convert utf8 to Chinese: first decode the encoded URL string through the "urldecode" function; then use the "mb_convert_encoding" function to convert the character encoding; and finally output the conversion result.

How to convert PHP utf8 to Chinese

Specific question:

To convert a specified set of UTF-8 encoded Chinese characters into normal Simplified Chinese

I tried the mb_convert_encoding function, but it didn’t work. The string I want to convert is encoded in this way. I don’t know if this is UTF-8 encoding

Jilin

Use other tools to transfer this set of codes. The tool shows "Jilin"?

Solution:

<?
$a=urldecode("%E5%90%89%E6%9E%97");
$a=mb_convert_encoding($a, &#39;GB2312&#39;, &#39;UTF-8&#39;);
echo $a;
?>
Copy after login

For a lot of related knowledge, please visit PHP Chinese website!

The above is the detailed content of How to convert PHP utf8 to Chinese. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template