Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 nsstring @"I\xe2\x80\x99m" 我想转换为 NSString @"I'm" 知道怎么做吗?谢谢!
NSString文字@"I\xe2\x80\x99m"已经是,"I’m"无需转换。
NSString
@"I\xe2\x80\x99m"
"I’m"
示范:
#include <Foundation/Foundation.h> int main() { NSLog(@"I\xe2\x80\x99m"); return 0; }
程序输出:
2013-05-21 14:12:33.471 a.out[452:707] I’m
您在源代码中输入的转义序列以 UTF-8 进行解释,并将生成的 UTF-8 制成一个NSString对象。