NSUTF8StringEncoding problems
NSUTF8StringEncoding problems
- Subject: NSUTF8StringEncoding problems
- From: Rakka <email@hidden>
- Date: Fri, 11 Mar 2005 21:17:16 +1100
I am appending the output of an NSTask (NSData) into a textview with
the following code, and it works perfectly fine for "normal" text, but
if the output contains non-english characters, such as japanese, wierd
things are displayed.
NSString *inText = [[NSString alloc] initWithData:inData
encoding:NSASCIIStringEncoding];
[logField replaceCharactersInRange:textEnd withString:inText];
I tried changing NSASCIIStringEncoding to NSUTF8StringEncoding, but
then an exception is raised saying withString is nil, whenever
non-english characters were in the output.
Is there any way I can make the incoming data UTF8 without errors so I
can append it to the textview?
Thanks
Regards
_______________________________________________
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