获取中文字符串的拼音

 
 

获取中文字符串的拼音

- (NSString *)phonetic {
    NSMutableString *source = [self mutableCopy];
    CFStringTransform((CFMutableStringRef)source, NULL, kCFStringTransformMandarinLatin, NO);
    CFStringTransform((CFMutableStringRef)source, NULL, kCFStringTransformStripDiacritics, NO);
    return [source autorelease];
}


你可能感兴趣的:(获取中文字符串的拼音)