Re: NSTask vs. special characters
Re: NSTask vs. special characters
- Subject: Re: NSTask vs. special characters
- From: Rosyna <email@hidden>
- Date: Sun, 29 Apr 2007 17:45:44 -0700
Yeah, this is bad. It's not just IIRC, it's documented..
http://developer.apple.com/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html
"Null-terminated array of 8-bit unsigned characters. %s interprets
its input in the system encoding rather than, for example, UTF-8."
And the source code
(http://www.opensource.apple.com/darwinsource/10.4.9.x86/CF-368.28/String.subproj/CFString.c
) says:
__CFStringAppendBytes(outputString, str, len, __CFStringGetSystemEncoding());
So if you're using that stringWithFormat:@"%s", that's your problem.
Ack, at 4/29/07, Rosyna said:
- (NSString*) fileSystemString
{
NSString *string = [NSString stringWithFormat:@"%s", [self
fileSystemRepresentation]];
return string;
}
Here's the big problem... IIRC, %s interprets the string as the
system encoding. (Which would be either MacFrench or MacRoman in
your case).
--
Sincerely,
Rosyna Keller
Technical Support/Carbon troll/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
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