• 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: Illegal byte sequence
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Illegal byte sequence (From: "Mark Wagner" <email@hidden>)
 >Re: Illegal byte sequence (From: Chris Espinosa <email@hidden>)
 >Re: Re: Illegal byte sequence (From: "Mark Wagner" <email@hidden>)

  • Prev by Date: Re: Build slowdown with 4 processors vs. 2 or 1?
  • Next by Date: Re: Illegal byte sequence
  • Previous by thread: Re: Re: Illegal byte sequence
  • Next by thread: Re: Illegal byte sequence
  • Index(es):
    • Date
    • Thread