How do I convert a NSString into TIS-620 encoded string
- by MacPC
In the apple document, I can see that there's a way to convert from UTF8 string to ASCII string like this
NSData *asciiData = [theString dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *asciiString = [[NSString alloc] initWithData:asciiData encoding:NSASCIIStringEncoding];
But my app requires a TIS-620 string to post to a site so I try to do the same thing
NSData *asciiData = [newPost.header dataUsingEncoding:kCFStringEncodingMacThai allowLossyConversion:YES];
NSString *asciiString = [[NSString alloc] initWithData:asciiData encoding:kCFStringEncodingMacThai];
NSLog(@"%@", asciiString);
The output I got is like this ???????????.
Does anyone know how to convert the NSString to TIS-620 properly?
Thanks so much.