07-30(NSString转UTF8)

NSString *cityName = @"德州市";

NSCharacterSet *allowedCharacters = [[NSCharacterSet characterSetWithCharactersInString:cityName] invertedSet];

NSString *encodedString = [cityName stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters];

你可能感兴趣的:(07-30(NSString转UTF8))