Re: Foolish question about NSStrings
Re: Foolish question about NSStrings
- Subject: Re: Foolish question about NSStrings
- From: Chris Ridd <email@hidden>
- Date: Thu, 28 Nov 2002 07:10:01 +0000
On 27/11/02 10:32 pm, Erik J. Barzeski <email@hidden> wrote:
>
Hi,
>
>
On 11/27/02 5:09pm, Chris Ridd <email@hidden> wrote:
>
> How do you construct a static NSString in source code that contains
>
> arbitrary Unicode characters while keeping the source code in ASCII?
>
>
You don't.
:-(
>
Read up on the helpful @"" construction and you'll see that it's intended to
>
be used for 7-bit strings only. Construct your string in some other accepted
I mentioned that I couldn't find any documentation of the @"..." construct
at all - it isn't even in the Objc-C grammar in Apple's Objc-C book - where
did you see this?
>
method and declare it static if you want.
>
>
Alternatively, of course:
>
NSLocalizedString(@"myUnicodeString","localizable.strings can be UTF");
I had another response suggesting the first workaround. I am using the
localizable.strings method already (and according to some Apple
documentation you can embed Unicode using \U as well as writing the whole
file in say UTF-8), but that's obviously not a good solution if the program
really does need specific strings of Unicode regardless of language setting.
I think permitting something like \uxxxx would be a useful enhancement for
the compiler.
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.