Home > Backend Development > PHP Tutorial > 有哪位高手理解编码知识,utf-8,gbk,big2,unicode 之间的转换?请高手帮忙

有哪位高手理解编码知识,utf-8,gbk,big2,unicode 之间的转换?请高手帮忙

WBOY
Release: 2016-06-13 13:43:35
Original
814 people have browsed it

有谁理解编码知识,utf-8,gbk,big2,unicode 之间的转换?请高手帮忙啊
function CHSUtoUTF8($c)
  {
  $str='';

  if ($c   {
  $str .= $c;
  }
  elseif ($c   {
  $str .= (0xC0 | $c >> 6);
  $str .= (0x80 | $c & 0x3F);
  }
  elseif ($c   {
  $str .= (0xE0 | $c >> 12);
  $str .= (0x80 | $c >> 6 & 0x3F);
  $str .= (0x80 | $c & 0x3F);
  }
  elseif ($c   {
  $str .= (0xF0 | $c >> 18);
  $str .= (0x80 | $c >> 12 & 0x3F);
  $str .= (0x80 | $c >> 6 & 0x3F);
  $str .= (0x80 | $c & 0x3F);
  }

  return $str;
  }


QQ:1302781404  

希望能够解决!

------解决方案--------------------
你写的这个有问题?
------解决方案--------------------
编码转换的过程是

1)先解码-》再用另一种方式去编码

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