NSString initWithData: NSUTF8StringEncoding - returns 'nil'
NSString initWithData: NSUTF8StringEncoding - returns 'nil'
- Subject: NSString initWithData: NSUTF8StringEncoding - returns 'nil'
- From: Lance Drake <email@hidden>
- Date: Fri, 3 Dec 2004 10:52:10 -0700
Hi Cocoa Folks,
I'm reading an RTF file which is contained in a binary file. I need to
create an RTF file on the HD - but am having a problem when I try to
move the data thru the system.
The following line of code works 'sometimes' with the same data:
NSString* theString = [[NSString alloc] initWithData:strData
encoding:NSUTF8StringEncoding];
This line of code always works - with the very same data input:
NSString* theString = [[NSString alloc] initWithData:strData
encoding:NSASCIIStringEncoding];
The data is an RTF file which currently does not contain any special
UTF8 characters - but could.
Any ideas as to how better to create a UTF8 string from data?
Thanks for whatever insights may come to mind,
Lance Drake
_______________________________________________
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