stringWithContentsOfURL: usedEncoding: error:
stringWithContentsOfURL: usedEncoding: error:
- Subject: stringWithContentsOfURL: usedEncoding: error:
- From: Greg Stark <email@hidden>
- Date: Mon, 5 Jun 2006 20:11:36 -0600
I'm trying to open a simple text file, and when I try to use
stringWithContentsOfURL: usedEncoding: error:, I get an error that
"The file could not be opened using the specified text encoding"
which is a little confusing in that I thought it was the method's job
to determine the encoding. If I use just stringWithContentsOfURL,
the file opens without problem. The code that I'm using is below:
NSStringEncoding *enc;
NSError *error;
NSString *test = [NSString stringWithContentsOfURL:[URLsToOpen
objectAtIndex:0]
usedEncoding:&enc
error:&error];
I'm I doing something wrong, or is there a problem with this method?
Thanks,
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden