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: Nonbreaking spaces in alerts



ons 2005-10-19 klockan 10:46 -0400 skrev Sean McBride:

> >No, it's not GCC that is mangling the string, it's whatever code runs  
> >when the @ is seen before a string. GCC itself delivers UTF-8 when it  
> >encounters a \u inside a string. Therefore the following works:
> >
> >(remember that you need the -std=c99 compiler option for this to work)
> >
> >NSString *s = [NSString stringWithUTF8String:"Mac\u00A0OS\u00A0X"];
> >
> >And yes, I just tried it myself. :-)
> 
> How lame it is that 
> 
> NSString *s = [NSString stringWithUTF8String:"Mac\u00A0OS\u00A0X"];
> 
> is ok, but
> 
> NSString *s = @"Mac\u00A0OS\u00A0X";
> 
> is not.  But it's not gcc's fault.  The Objective-C documentation says:

It's extremely lame, indeed.

> "@"string" - Defines a constant NSString object in the current module
> and initializes the object with the specified 7-bit ASCII-encoded string."
> 
> So the language is defined that way, the compiler must follow.

Actually, since UTF-8 is fully backwards compatible with US-ASCII they
could easily support it.

It is in the end, I guess, just lame. Just like you said.

Perhaps a feature request is in order.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Nonbreaking spaces in alerts (From: "Paul J. Lucas" <email@hidden>)
 >Re: Nonbreaking spaces in alerts (From: John Stiles <email@hidden>)
 >Re: Nonbreaking spaces in alerts (From: "Paul J. Lucas" <email@hidden>)
 >Re: Nonbreaking spaces in alerts (From: Elias Mårtenson <email@hidden>)
 >Re: Nonbreaking spaces in alerts (From: John Stiles <email@hidden>)
 >Re: Nonbreaking spaces in alerts (From: Elias Mårtenson <email@hidden>)
 >Re: Nonbreaking spaces in alerts (From: John Stiles <email@hidden>)
 >Re: Nonbreaking spaces in alerts (From: Elias Mårtenson <email@hidden>)
 >Re: Nonbreaking spaces in alerts (From: "Sean McBride" <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.