NSString encoding and perl script encoding
NSString encoding and perl script encoding
- Subject: NSString encoding and perl script encoding
- From: "David Brennan" <email@hidden>
- Date: Thu, 1 Feb 2007 15:53:38 +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