stringWithContentsOfFile:usedEncoding returns no err and no encoding
stringWithContentsOfFile:usedEncoding returns no err and no encoding
- Subject: stringWithContentsOfFile:usedEncoding returns no err and no encoding
- From: Trygve Inda <email@hidden>
- Date: Fri, 30 May 2014 21:59:01 -0700
- Thread-topic: stringWithContentsOfFile:usedEncoding returns no err and no encoding
I have a database file exported as text from FileMaker which has several
high-ASCII French characters.
NSError* error = nil;
NSStringEncoding* enc = nil;
NSString* contents = [NSString stringWithContentsOfFile:path
usedEncoding:enc error:&error];
This works but enc and error are both nil after the method returns, even
though contents is correct.
NSString* contents = [NSString stringWithContentsOfFile:path encoding:
NSASCIIStringEncoding error:&error];
This one returns no error but the high ASCII French acented chars are messed
up.
NSString* contents = [NSString stringWithContentsOfFile:path encoding:
NSUTF8StringEncoding error:&error];
This returns error 261 (file can't be interpreted).
So why in the first example is it working (no error) but also not returning
any encoding value?
Trygve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden