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 不带声调 }
时间: 2024-10-18 06:40:23