Re: Unicode and NSTextView
Re: Unicode and NSTextView
- Subject: Re: Unicode and NSTextView
- From: "Alastair J.Houghton" <email@hidden>
- Date: Fri, 22 Aug 2003 19:19:19 +0100
On Friday, August 22, 2003, at 05:50 pm, Chris Hanson wrote:
On Friday, August 22, 2003, at 08:01 AM, Timothy Larkin wrote:
I get the o-macron into the string by inserting an NSString constant.
Since I can make o-macron directly with Pop-char, I define in the
source @"<o-macron>".
Stop right there. Objective-C source code files are 7-bit ASCII. You
can't reliably put 8-bit characters of any sort in them.
That simply isn't true. You can write C and Objective C in *any*
superset of 7-bit ASCII, which includes (for example) UTF8, Shift-JIS,
MacRoman or almost every other 8-bit encoding you can think of.
Indeed, the C standard is quite explicit about the possibility of
multi-byte characters in source code... in 6.4.5 it says "A character
string literal is a sequence of zero or more multibyte characters
enclosed in double quotes", whilst in 6.4.9.1, it says "The contents of
a comment are examined only to identify multibyte characters and to
find the characters */ that terminate it". The only thing it doesn't
define is how the compiler is supposed to detect the file's encoding.
5.2.1.2 even seems to indicate that multibyte characters are permitted
in identifiers, although I doubt many compilers support *that*
behaviour ;-)
Anyway, if you do want to put anything other than 7-bit ASCII in a
file, it is best restricted to strings and comments.
Kind regards,
Alastair.
_______________________________________________
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.