• 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
Re: NSTask vs. special characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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>)

  • Prev by Date: Re: Why click to knob of NSSlider changes it's value?
  • Next by Date: NSScrollView contentSize bug?
  • Previous by thread: Re: NSTask vs. special characters
  • Next by thread: Re: NSTask vs. special characters
  • Index(es):
    • Date
    • Thread