Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask vs. special characters



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >NSTask vs. special characters (From: Pierre Bernard <email@hidden>)
 >Re: NSTask vs. special characters (From: Pierre Bernard <email@hidden>)
 >Re: NSTask vs. special characters (From: Rosyna <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.