Created
November 5, 2014 10:16
-
-
Save looping/21fb5827acc6ae205171 to your computer and use it in GitHub Desktop.
NSString to Unicode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)unicodeString:(NSString *)string { | |
NSMutableString *retString = [NSMutableString stringWithCapacity:0]; | |
for (int index = 0; index < [string length]; index++) { | |
[retString appendFormat:@"\\u%04x",[string characterAtIndex:index]]; | |
} | |
return retString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment