【问题标题】:Unicode Surrogate Pairs in IOS?IOS中的Unicode代理对?
【发布时间】:2013-03-19 05:51:11
【问题描述】:

我有一个代理对,示例如下:

\ud83d\ude04

我想知道如何获取“1F604”等对应的value值

任何示例代码?

任何帮助将是可观的?

【问题讨论】:

标签: ios xcode unicode ios6 surrogate-pairs


【解决方案1】:

要将代理对转换为 UTF-32 字符或代码点值,请使用 CFStringGetLongCharacterForSurrogatePair。例如:

UniChar high = 0xd83d;
UniChar low = 0xde04;

UTF32Char c = CFStringGetLongCharacterForSurrogatePair(high, low);

【讨论】:

  • 感谢您的回复。但是在我的情况下,如何将 \ud83d\ude04 传递给“高”和“低”
  • 那么我得到的 128516 不是 "1F604" 吗?
  • 128516 与hex 中的0x1F604 相同。
猜你喜欢
  • 1970-01-01
  • 2019-05-21
  • 2021-10-23
  • 2018-10-15
  • 2012-07-15
  • 2010-11-01
  • 1970-01-01
  • 2017-03-06
  • 2012-04-24
相关资源
最近更新 更多