Re: Foreign Characters
Re: Foreign Characters
- Subject: Re: Foreign Characters
- From: Ricky Sharp <email@hidden>
- Date: Fri, 15 Jun 2007 17:00:12 -0500
On Jun 15, 2007, at 12:07 PM, Peter Browne wrote:
I'm not sure if this is the right list to be asking such a
question, but here it goes:
I'm trying to write a screensaver module to flash up random Hebrew
words to help me with learning vocabulary, etc. but I'm not sure
exactly how to go about programmatically producing Hebrew
characters on screen.
Simply typing Hebrew characters into an NSString breaks everything,
and whilst I have a feeling I need to do something relating to
Unicode support, I have no idea where to begin .
Any pointers would be greatly appreciated. I'm sure this can't be
that hard to do after all.
First, it sounds like you're trying to place non-ASCII7 characters
directly into your source code. You should instead place your
strings into a .strings file with an encoding of UTF-16. You can
then load strings from that file using macros/functions such as
NSLocalizedString.
For example, contents of your .strings file may be:
/* word 1 */
"word1" = "<hebrew word/phrase goes here";
/* word 2 */
"word2" = ...
In your module you could then build up an array from this file by
looping over the keys (@"word1", @"word2", etc.) and obtaining their
values via NSLocalizedString.
Also, an NSArray of NSStrings will allow you to use keyed archiving
to load/save it from/to a file (see unarchiveObjectWithFile: and
archiveRootObject:toFile:) So, you could instead create say an
editor type of app that would allow you to load/save such an array of
strings.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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