Re: Entering UniCode
Re: Entering UniCode
- Subject: Re: Entering UniCode
- From: Chris Hanson <email@hidden>
- Date: Fri, 6 Feb 2004 10:42:42 -0600
On Feb 6, 2004, at 9:30 AM, Darrin Cardani wrote:
How does one enter UniCode characters into a string in Project Builder
given the UniCode value? I know the syntax is something like "\U0064",
but I can't seem to get it quite right, and I can't find anything in
the docs about it. Any help would be appreciated.
I don't believe there is any such syntax. Objective-C source files are
assumed to be ASCII and any static NSStrings (@"") are assumed to be in
the default encoding. So any non-ASCII characters need to go through
the localization (Unicode .strings file, NSLocalizedString macro)
mechanism.
I believe (but I'm not certain) that you can also cheat and tell
Project Builder or Xcode that your file is in UTF-8 encoding, and then
use +[NSString stringWithUTF8String:] to create an NSString from a C
string in UTF-8 encoding. Of course you'll also have to make sure your
source code control system will handle the file; some freak out on
non-ASCII data.
-- Chris
--
Chris Hanson <email@hidden>
bDistributed.com, Inc.
Outsourcing Vendor Evaluation
Custom Mac OS X Development
Cocoa Developer Training
_______________________________________________
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.