美文网首页
解决Xcode打印中文成Unicde问题

解决Xcode打印中文成Unicde问题

作者: Geniune | 来源:发表于2019-01-25 13:50 被阅读3次

    Git地址:https://github.com/Geniune/XcodeUnicode

    只需要将git仓库中的Category文件加入工程即可(无需import)

    NSDictionary *dictionary = @{@"name":@"李四",
                                 @"school":@"实验小学"};
    

    在Xcode中定义字符串类型对象若包含中文,控制台print时就会被转换成Unicode编码

    //Xcode默认打印:
    {
        name = "\U674e\U56db";
        school = "\U5b9e\U9a8c\U5c0f\U5b66";
    }
    //导入Category后打印:
    {
        name = "李四";
        school = "实验小学";
    }
    

    如果本文对你有所帮助记得点个喜欢哈

    相关文章

      网友评论

          本文标题:解决Xcode打印中文成Unicde问题

          本文链接:https://www.haomeiwen.com/subject/erpmjqtx.html