简体   繁体   中英

How to convert a utf-8 string to a utf-16 string in PHP

如何在PHP中将utf-8字符串转换为utf-16字符串?

mbstring 支持UTF-16 ,因此您可以使用mb_convert_encoding

You could also use iconv .

It's native in PHP, but require that all your text is one charset. Else it could discard characters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM