2013-03-19 31 views
-1

我有一個代理對,下面的例子:IOS中的代理代理對?

\ ud83d \ ude04

我想知道如何得到「1F604」

任何樣本代碼的相應值的值?

任何幫助將是可觀的?

+1

http://stackoverflow.com/questions/9062923/unicode-character-from-code-in-string-obj-c – iPatel 2013-03-19 05:56:57

+0

@iPatel感謝您的reply..I是在新iPhone dev.So我不知道如何使用上面的code.Can你請幫忙 – Jeff 2013-03-19 06:01:08

回答

1

要將代理對轉換爲UTF-32字符或代碼點值,請使用CFStringGetLongCharacterForSurrogatePair。例如:

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

UTF32Char c = CFStringGetLongCharacterForSurrogatePair(high, low); 
+0

謝謝你的答覆。但在我的情況下,如何通過\ ud83d \ ude04 '高'和'低' – Jeff 2013-03-19 10:41:09

+0

例I包括顯示你完全。 – 2013-03-20 01:15:28

+0

然後我得到128516不是「1F604」? – Jeff 2013-03-20 05:54:08