• 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: Initializing unichar variable with a human readable letter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initializing unichar variable with a human readable letter


  • Subject: Re: Initializing unichar variable with a human readable letter
  • From: James Bucanek <email@hidden>
  • Date: Tue, 20 Jul 2010 08:17:51 -0700

vincent habchi <mailto:email@hidden> wrote (Saturday, July 17, 2010 1:58 PM +0200):

I have a very simple problem: I'd like to affect to a unichar variable the value of the glyph é (or any non-ascii character).

Others can correct me if I'm wrong, but the basic problem here is that GCC does not, and cannot, know the character encoding of the source file. Thus, program source code must be restricted to ASCII and any non-ASCII characters are unpredictable and non-portable.


While you can often get away with sticking non-ASCII characters into string literals, it is a non-standard solution that is unsupported and fragile There's no guarantee that it will work with future (or past) versions of the compiler or if you move this project to another environment.

I'm not "the compiler police"--I use non-ASCII characters in my own code. Just be aware of what you're getting into. If this is your own project that will never be compiled anywhere else, you're probably fine (this situation hasn't changed in years). But if this a project that you're delivering to a client, will be used by other developers, or you expect to live for a very long time I'd probably take the time to develop a more robust solution.
--
James Bucanek


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Initializing unichar variable with a human readable letter
      • From: "Sean McBride" <email@hidden>
References: 
 >Initializing unichar variable with a human readable letter (From: vincent habchi <email@hidden>)

  • Prev by Date: Re: Core Data caching very large property values in 10.6
  • Next by Date: Re: managing split view iPad
  • Previous by thread: Re: Initializing unichar variable with a human readable letter
  • Next by thread: Re: Initializing unichar variable with a human readable letter
  • Index(es):
    • Date
    • Thread