• 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: Foolish question about NSStrings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Foolish question about NSStrings


  • Subject: Re: Foolish question about NSStrings
  • From: "Erik J. Barzeski" <email@hidden>
  • Date: Wed, 27 Nov 2002 17:32:42 -0500

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
method and declare it static if you want.

Alternatively, of course:
NSLocalizedString(@"myUnicodeString","localizable.strings can be UTF");

> What I want to do is something like this:
>
> NSString *foo = @"Price is \u20ac99.95";
>
> I was expecting something like "\uxxxx" but the compiler doesn't like that.
> None of the obvious documentation (gcc docs, c preprocessor docs, Objc-C
> Programming Language) discusses this, and a few searches on mamasam didn't
> turn anything useful up apart from a similar (and unanswered!) question.
>
> Cheers,
>
> Chris

--
Kindest regards,
Erik J. Barzeski

There are two great secrets to success in life.
The first is to not tell everything you know.
###################################################################
Email: erik@(anything below) AIM: iacas

http://iacas.org http://weims.net
http://techstra.net http://barzeski.com
http://cocoadevcentral.com http://soundsetcentral.com
http://freshlysqueezedsoftware.com http://applescriptcentral.com
###################################################################
_______________________________________________
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.

  • Follow-Ups:
    • Re: Foolish question about NSStrings
      • From: Chris Ridd <email@hidden>
  • Prev by Date: Re: How to know if a modem is installed?
  • Next by Date: Re: NSTextView text changes size
  • Previous by thread: Foolish question about NSStrings
  • Next by thread: Re: Foolish question about NSStrings
  • Index(es):
    • Date
    • Thread