Created
July 29, 2011 10:25
-
-
Save Azuritul/1113579 to your computer and use it in GitHub Desktop.
使用usedEncoding及big5 encoding轉換
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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