【发布时间】:2012-07-02 08:39:30
【问题描述】:
在 Obj-C 中,如何将\u20000 转换为这个最终字符串:"%F0%A0%80%80"(将用于构建 URL)?
仅供参考:根据this page,\u20000=0x00020000in UTF-32(十六进制)或0xF0 0xA0 0x80 0x80in UTF-8(十六进制)。
【问题讨论】:
标签: objective-c unicode nsstring type-conversion
在 Obj-C 中,如何将\u20000 转换为这个最终字符串:"%F0%A0%80%80"(将用于构建 URL)?
仅供参考:根据this page,\u20000=0x00020000in UTF-32(十六进制)或0xF0 0xA0 0x80 0x80in UTF-8(十六进制)。
【问题讨论】:
标签: objective-c unicode nsstring type-conversion
我最终使用了@ParagBafna 的建议,即使用来自this link 的代码ConvertUTF。它工作得很好。
【讨论】: