Re: Illegal byte sequence
Re: Illegal byte sequence
- Subject: Re: Illegal byte sequence
- From: Syd Polk <email@hidden>
- Date: Fri, 8 Dec 2006 00:41:08 -0600
On Dec 7, 2006, at 5:58 PM, Mark Wagner wrote:
A binary search (delete half the file, then compile) shows that the
problem is on line 57:
wchar_t data_chars[] = {
L"ÆÁÂÀÅÃÄÇ*ÉÊÈËÑÓÔÒØÕÖ*ÚÛÙÜ*á´âæàåãä|ç*¢(c)€°÷éêè—
*ë***íî¡ì¿ï«ÍÎÌϯµ*\x00A0¬ñóôòªºøõö¶±£»(r)§–ß*X™úûù¨ü*¥ÿ\0"
};
(in case it doesn't come through correctly, that's a whole series of
characters with values greater than 127). The file's encoding is set
to Mac OS Roman.
Hmm. You have files that end in .C that are C files (an artifact of
either old Mac or Windows), that have CRLF line endings (an artifact
of Windows), and are encoded in MacRoman (an artifact of Mac). The
history of this source is probably pretty interesting. How do you get
the Windows compilers to understand MacRoman?
That being said, gcc uses UTF-8. Your MacRoman characters are not
being interpreted as MacRoman by the compiler. You can use any
CHARSET defined by iconv. Google for "gcc UTF-8" for articles on
this. For gcc to treat this as MacRoman, you need to add "-fwide-exec-
charset=MACROMAN" to your CFLAGS.
One way around this is to use gettext().
However, the better solution is to put this into a .Strings file in a
nib so that it can be localized properly and automatically. You would
then load the string out of the nib, and you would not have to worry
about compiler character set. You could similarly put it in a
resource for Carbon, and load it using the Resource Manager calls.
Syd Polk
email@hidden
"Let the music be your light" - Dave Edwards, KUHF-FM, 1982
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden