Last active
December 23, 2015 06:05
-
-
Save ourui/c548dc0a6e3de3ccd03b to your computer and use it in GitHub Desktop.
Covert Chinese Word To PinYin
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
NSMutableString *ms = [[NSMutableString alloc] initWithString:@"我是中国人"]; | |
if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformMandarinLatin, NO)) { | |
NSLog(@"Pingying: %@", ms); // wǒ shì zhōng guó rén | |
} | |
if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformStripDiacritics, NO)) { | |
NSLog(@"Pingying: %@", ms); // wo shi zhong guo ren | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment