首页 > 代码库 > 中文变英文字母(ios)

中文变英文字母(ios)

[_EnglishName setString:addressPerson.name];
if (CFStringTransform((__bridge CFMutableStringRef)_EnglishName, 0, kCFStringTransformMandarinLatin, NO)) {
NSLog(@"Pingying: %@", _EnglishName); // wǒ shì zhōng guó rén
}
if (CFStringTransform((__bridge CFMutableStringRef)_EnglishName, 0, kCFStringTransformStripDiacritics, NO)) {
NSLog(@"Pingying: %@", _EnglishName); // wo shi zhong guo ren
}