What encoding to use to turn NSData from a subprocess into an NSString?
What encoding to use to turn NSData from a subprocess into an NSString?
- Subject: What encoding to use to turn NSData from a subprocess into an NSString?
- From: Gerben Wierda <email@hidden>
- Date: Wed, 24 May 2006 01:14:22 +0200
If I have a NSFileHandle that reads from a unix subprocess the stderr
output (this is supposed to be readable output, say the output of a
gnutar command) what encoding do I use to turn the NSData I get with
availableData into an NSString (using initWIthData:encoding)?
The data is ascii, generally, but I cannot be sure there is no 8-bit
value in there. What happens if NSASCIIStringEncoding encounters an 8-
bit value (say an accented character)?
I have been using NSUTF8StringEncoding so far because I read the docs
as that this was an 8 bit encoding. But I have been told that this is
wrong.
Thanks,
G
_______________________________________________
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