1

PHP を使用し て UTF-16
U+610F
スタイルの文字を UTF-8 (16 進数)に変換することは可能ですか?
E6848F

UTF-8 文字は「意」です

4

2 に答える 2

1

From the comments in the chr man page, one quick hack for turning an ordinal character number into a UTF-8 byte sequence:

function unichr($u) {
    return mb_convert_encoding('&#' . intval($u) . ';', 'UTF-8', 'HTML-ENTITIES');
}

// unichr(0x610F) -> "\xE6\x84\x8F"
于 2010-04-19T19:51:28.950 に答える
0

phpにはUnicodeのエンコードとデコードがあります..それを試してみましょう

utf8_decode(); or utf8_encode();
于 2010-04-19T19:08:39.203 に答える