请问下unicode编码如何输出汉字

WBOY
Release: 2016-06-23 13:30:59
Original
1453 people have browsed it

unicode 十进制值为26575 对应汉字应该是“柏”,PHP中怎样通过这个十进制值输出这个汉字呢?急,在线等


回复讨论(解决方案)

$n = 26575;echo mb_convert_encoding(sprintf('&#%d;', $n), "gbk", 'HTML-ENTITIES');echo iconv('ucs-2', 'gbk', pack('n', $n));
Copy after login

两种都可以

UCS-2 和 UTF-16 等价

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