zoukankan      html  css  js  c++  java
  • ObjectiveC Unicode 转换成中文

    1.  (NSString *)replaceUnicode:(NSString *)unicodeStr {  
    2.       
    3.     NSString *tempStr1 = [unicodeStr stringByReplacingOccurrencesOfString:@"\\u" withString:@"\\U"];  
    4.     NSString *tempStr2 = [tempStr1 stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];  
    5.     NSString *tempStr3 = [[@"\"" stringByAppendingString:tempStr2] stringByAppendingString:@"\""];  
    6.     NSData *tempData = [tempStr3 dataUsingEncoding:NSUTF8StringEncoding];  
    7.     NSString* returnStr = [NSPropertyListSerialization propertyListFromData:tempData  
    8.                                                                                              mutabilityOption:NSPropertyListImmutable   
    9.                                                                                                             format:NULL  
    10.                                                                                               errorDescription:NULL];  
    11.       
    12.     //NSLog(@"Output = %@", returnStr);  
    13.       
    14.     return [returnStr stringByReplacingOccurrencesOfString:@"\\r\\n" withString:@"\n"];  
    15. }  
  • 相关阅读:
    关于数据库的基础知识
    Oracle数据库的上机作业
    PHP表单处理
    EasyUI DataGrid结合ThinkPHP实现增删改查操作———初学者
    Redis crackit
    nodeppt安装后,phantomjs不能运行了 Bad argument
    redis命令
    eclipse编辑web.xml很慢
    客制化jasperreport导出html的过程
    dynamicreport, JFreeChart
  • 原文地址:https://www.cnblogs.com/luyinghuai/p/1955130.html
Copyright © 2011-2022 走看看