Created
June 6, 2015 07:22
-
-
Save revolc/c22c6c5a62f297ffb063 to your computer and use it in GitHub Desktop.
This file contains 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 *pinyin = [name mutableCopy]; | |
if (!CFStringTransform((__bridge CFMutableStringRef)pinyin, 0, kCFStringTransformMandarinLatin, NO)) { | |
DDLogWarn(@"拼音转换[步骤1]失败: %@ -> %@", name, pinyin); | |
} | |
if (!CFStringTransform((__bridge CFMutableStringRef)pinyin, 0, kCFStringTransformStripDiacritics, NO)) { | |
DDLogWarn(@"拼音转换[步骤2]失败: %@ -> %@", name, pinyin); | |
} | |
pinyin = [pinyin stringByReplacingOccurrencesOfString:@" " withString:@""]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment