How to change GB-2312 encoding to UTF-8
问题 I use nsurlsession and received nsdata with GB-2312 encoding. How can I change the encoding from GB-2312 to UTF-8. I tried this code let enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000) var result = NSString(data: data, encoding:enc)! but it has an error Use of unresolved identifier 'kCFStringEncodingGB_18030_2000' 回答1: I solved this issue with using the concrete value of gb312 constant instead of the apple defined constant let enc =