• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
What encoding to use to turn NSData from a subprocess into an NSString?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: What encoding to use to turn NSData from a subprocess into an NSString?
      • From: "Shawn Erickson" <email@hidden>
    • Re: What encoding to use to turn NSData from a subprocess into an NSString?
      • From: Keary Suska <email@hidden>
  • Prev by Date: NIB problem after upgrading to 2.3
  • Next by Date: Set filePackage
  • Previous by thread: Re: NSMatrix with NSTextFieldCells
  • Next by thread: Re: What encoding to use to turn NSData from a subprocess into an NSString?
  • Index(es):
    • Date
    • Thread