• 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
NSString encoding and perl script encoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString encoding and perl script encoding


  • Subject: NSString encoding and perl script encoding
  • From: "David Brennan" <email@hidden>
  • Date: Thu, 1 Feb 2007 15:34:57 +0000

Hi,

I am sending text from my NSString to a perl script using a NSPipe,
and I'm trying to read the result from the script using a pipe. When I
send the text I use the encoding NSUTF8StringEncoding to create a
NSData object. When I read the result from the pipe, I also use
NSUTF8StringEncoding to convert the NSData to NSString.

At the start of my script I tell it to use 'utf8', see below.

But when I try to create the NSString from the NSData that is sent
back from the script, it fails. It seems that the encoding is
incorrect.

I am working on Tiger. What encoding should I use?

Thanks,
Dave.

use encoding 'utf8';

while (defined($line = <STDIN>))
{
   print $line
}
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString encoding and perl script encoding
      • From: Chris Ridd <email@hidden>
  • Prev by Date: Re: Please can any one sugest or send me Email validation code.
  • Next by Date: Re: Please can any one sugest or send me Email validation code.
  • Previous by thread: Re: [Q] What encoding method can be automatically detected?
  • Next by thread: Re: NSString encoding and perl script encoding
  • Index(es):
    • Date
    • Thread