Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use Unicode with Carbon



On Jun 10, 2007, at 12:48 PM, Felipe Monteiro de Carvalho wrote:

On 6/10/07, David Duncan <email@hidden> wrote:
CFSTR() (and I presume the derived CFSTRP?) doesn't understand UTF-8,
only ASCII. If you want to use UTF-8 text, you have to create the
string yourself, or better yet load it from a strings file (which can
be encoded as UTF-8 or UTF-16).

The big and strings file solutions aren't possible, because I am using carbon to implement a GUI framework which supports setting strings at run-time

Honestly, that's not relevant :). If you want to be able to create a CFStringRef from a Pascal string at runtime, use CFStringCreateWithPascalString(). But your framework should still allow actual CFStringRef objects to be passed around directly, as they are the premier string representation on Mac OS X.


Your framework should just as easily allow strings to come from strings files or to load UI elements from a nib if you want to be able to deal with localization in a sane way. In theory you could reinvent the wheel by defining your own serialized UI format, but then you have to create your own tools etc - why do that to yourself?

Are there examples available for creating the string myself?

I'm sure there are plenty (in C) on developer.apple.com. But honestly, I've never noticed anything in particular that was complicated about creating one.
--
David Duncan
Apple DTS Quartz and Printing
email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >How to use Unicode with Carbon (From: "Felipe Monteiro de Carvalho" <email@hidden>)
 >Re: How to use Unicode with Carbon (From: David Duncan <email@hidden>)
 >Re: How to use Unicode with Carbon (From: "Felipe Monteiro de Carvalho" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.