Skip to content

Instantly share code, notes, and snippets.

@Azuritul
Created July 29, 2011 10:25
Show Gist options
  • Save Azuritul/1113579 to your computer and use it in GitHub Desktop.
Save Azuritul/1113579 to your computer and use it in GitHub Desktop.
使用usedEncoding及big5 encoding轉換
NSStringEncoding usedEncoding;
NSError * err;
NSString * k = [NSString stringWithContentsOfFile:path usedEncoding:&usedEncoding error:&err];
if (err) {
NSStringEncoding big5 = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingBig5_HKSCS_1999);
k = [NSString stringWithContentsOfFile:path encoding:big5 error:&err];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment