vincent habchi <mailto:vi...@macports.org> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to