Re: Umlaute in NSString
Re: Umlaute in NSString
- Subject: Re: Umlaute in NSString
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 22 Mar 2004 08:54:28 -0700
On Mar 22, 2004, at 8:19 AM, Michael Becker wrote:
(The umlaut turns into a square-root-sign and a degree-sign)
I am not really familiar with character encodings, so could somebody
please tell me how to get rid of this and make the application draw
the correct umlaut?
Unfortunately, this list eats non-ASCII characters in message bodies,
so I don't think we got the message as you probably intended it.
Anyway, NSString constants written in code using @"" may only contain
ASCII characters, so if you tried to write a character with an umlaut
in one of them, then I'm not surprised that it didn't work.
There are two ways to do this:
1. Use NSLocalizedString() and friends with an ASCII key to get a
non-ASCII string
2. Use NSString's -stringWithCharacters: method like this:
unichar lowercaseUmlautU = 252; // the Unicode value of character
"LATIN SMALL LETTER U WITH DIAERESIS"
NSString *theString = [NSString stringWithFormat:@"U-Umlaut: %@",
[NSString stringWithCharacters:&lowercaseUmlautU length:1]];
Nick Zitzmann
<
http://www.chronosnet.com/>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.