【发布时间】:2013-03-19 05:51:11
【问题描述】:
我有一个代理对,示例如下:
\ud83d\ude04
我想知道如何获取“1F604”等对应的value值
任何示例代码?
任何帮助将是可观的?
【问题讨论】:
-
@iPatel 谢谢你的回复..我是 iPhone 开发新手。所以我不知道如何使用上面的代码。你能帮忙
标签: ios xcode unicode ios6 surrogate-pairs
我有一个代理对,示例如下:
\ud83d\ude04
我想知道如何获取“1F604”等对应的value值
任何示例代码?
任何帮助将是可观的?
【问题讨论】:
标签: ios xcode unicode ios6 surrogate-pairs
要将代理对转换为 UTF-32 字符或代码点值,请使用 CFStringGetLongCharacterForSurrogatePair。例如:
UniChar high = 0xd83d;
UniChar low = 0xde04;
UTF32Char c = CFStringGetLongCharacterForSurrogatePair(high, low);
【讨论】:
128516 与hex 中的0x1F604 相同。