Re: Strange characters in Toolbar
Re: Strange characters in Toolbar
- Subject: Re: Strange characters in Toolbar
- From: Andrew Thompson <email@hidden>
- Date: Wed, 19 Nov 2003 20:02:55 -0500
On Nov 17, 2003, at 11:19 PM, Sean McBride wrote:
Andrew Thompson (email@hidden) on Mon, Nov 17, 2003 22:46 said:
Essentially because there's no C language standard for Unicode string
literals.
I'm not a language lawyer, but I remember something from the
CodeWarrior
9 release notes... Ah, yes, here it is:
"As per ISO C++98 and C99, universal characters may be used in any
string
or character literal, identifiers (macros, variables, functions,
methods,
etc.), and comments. These characters are derived either from
multibyte
sequences in the source text, by virtue of the source file being
encoded
in UCS-2 or UCS-4, or by use of the \uXXXX or \UXXXXXXXX escape
sequences."
If I read that right, I should be able to have unicode string literals.
And as Obj-C is an 'extension' to C (C99 or C89?) I would expect the
@""
notation to be able to support it. Maybe it works with CW 9 even
though
it doesn't work with gcc...
I think that's saying it should be possible to write code like this:
unichar c = \u1234; // I know this works because I use it
This might also work:
unichar *string = "hello \u1234"; //but I've never tried this
What would ideally work is what will work in Java[*], assuming your
file is saved in UTF-8 (or you tell the compiler you want UCS-2 or 4)
unichar *string = "hello <bunch of literal unescaped Japanese, Chinese,
Arabic etc>, ie put directly in the string with no \u style escaping at
all".
I think CodeWarrior supports this if you use this syntax:
foo = L"unicode sting";
But I don't think that's part of any official standard.
[1] Of course, most people in the West edit Java on Latin-1 systems and
use the default encoding, so most multibyte characters are escaped in
most Java code too, but I'm sure that's not true in other parts of the
world, and you can choose to use UTF-8 for your source files if you
want to.
AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside
(see you later space cowboy ...)
_______________________________________________
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.