中文变英文字母(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
}

你可能感兴趣的:(ios)