Re: Multiple Languages Font Menu
Re: Multiple Languages Font Menu
- Subject: Re: Multiple Languages Font Menu
- From: Rainer Brockerhoff <email@hidden>
- Date: Tue, 27 Nov 2001 18:35:34 -0200
Date: Tue, 27 Nov 2001 15:10:01 +0800
From: Johnny CN Lee <email@hidden>
I want to create a NSComboBox which contains font names for the user to
select. I use the following code to do it:
...
fontString = [NSString stringWithCString:&itemString[1]];
...
All fonts with English names are displayed correctly, but not for Japanese
font names. All Japanese characters are displayed as Latin characters.
Have I done anything wrong?
Yes :-).
The error is in the line I left in. stringWithCString means MacRoman
encoding, which encodes most western-language accented characters,
but nothing in Japanese.
Try:
fontString = [NSString stringWithUTF8String:&itemString[1]];
that might do it...
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Oct. 2001)