|
|
Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » some non-english characters don't display
some non-english characters don't display [message #932] |
Thu, 09 February 2006 14:44  |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
I can't seem to be able to write some of the characters of the hungarian language into the code editor. The problematic chars are:
ő (o with two paralel lines above it)
ű (u with two paralel lines above it)
When I press the specific key, the char simply does not get inserted. Other applications, including text editors can accept these chars.
|
|
|
|
|
|
|
Re: some non-english characters don't display [message #1314 is a reply to message #1313] |
Mon, 27 February 2006 21:37   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
"Courier" (non TTF bitmap font) is missing cyrillic characters (you can check this by "Character map" in Win Accessories/System tools).
To enter cyrillic characters, you have to set the right code-page for your file (U++ stores codepage of package and file in package information).
Current codepage is displayed in the window caption. Default codepage is windows-1252, but that does not allow cyrillic chars. Please check that.
You can set code-page in Package organizer or File properties.
Mirek
[Updated on: Mon, 27 February 2006 21:38] Report message to a moderator
|
|
|
|
|
Re: some non-english characters don't display [message #1320 is a reply to message #1317] |
Mon, 27 February 2006 22:25   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
luzr wrote on Mon, 27 February 2006 16:19 |
dr_jumba wrote on Mon, 27 February 2006 16:09 | I have set 'koi8-r' everywhere in file properties, package organizer and setup for environment. Still can't type cyrillic.
Output of 'locale' is the following:
LANG=ru_RU.KOI8-R
LC_CTYPE="ru_RU.KOI8-R"
LC_COLLATE="ru_RU.KOI8-R"
LC_TIME="ru_RU.KOI8-R"
LC_NUMERIC="ru_RU.KOI8-R"
LC_MONETARY="ru_RU.KOI8-R"
LC_MESSAGES="ru_RU.KOI8-R"
LC_ALL=
One more thing. ide falls to core when I try to set encoding in package organizer to two or more packages simultanuosly without pressing OK button.
|
Ahh, sorry, as you were speaking about Courier, I came to conclusion you are speaking about Win32.
Well, I think that this is a bug (or rather unimplemented feature). So far, U++ was tested with (and developed for) UTF-8 linux systems.
You can check the code in CtrlCore/X11Proc.cpp around line 137.
Mirek
|
Staring at the code
Status status;
int len = XmbLookupString(w.xic, &event->xkey, buff, sizeof(buff), &keysym, &status);
buff[len] = 0;
if(status == XLookupChars || status == XLookupBoth)
chr = FromUtf8(buff, len)[0];
I think that the problem is that instead of FromUtf8 (only) there should be general conversion based on current locale...
Mirek
|
|
|
|
|
|
|
|
|
Re: some non-english characters don't display [message #4387 is a reply to message #932] |
Fri, 04 August 2006 13:31   |
 |
Raygun
Messages: 3 Registered: August 2006
|
Junior Member |
|
|
Umm.. guys..
Please help a newcomer 
I'm trying to write my labels in Russian, but to no avail.
In .lay-designer everything seems just fine, since I've reinstalled everything and set codepage to Win-1251 since the very start. Yes, I've tried to simply change the codepage before, but my problem remained, hence -> the reinstallation.
Okay, I can type in Russian and see the text on my controls, fine. But as soon as I start my app, the text is in gibberish, that is European chars from the second part of (8-bit ) ASCII table are used.
It looks like my application is using a wrong (i.e. w/o Cyrillic chars) font. You see, when I create a form in MS Visual Studio (2003), the font selection dialog looks like this -
http://img211.imageshack.us/my.php?image=fontselcrwd2.png
As you can see, it allows you to select encoding for your font, which is great. The IDE's font selection panel doesn't offer this.
Could someone please explain, how to use Cyrillic characters on controls?
P.S. I'm on WinXP SP1, English, but Russian fonts/keyboard layout are installed, no problem with that whatsoever, Russian filenames are ok, everything works.
|
|
|
|
|
|
Re: some non-english characters don't display [message #4409 is a reply to message #4391] |
Sat, 05 August 2006 17:04   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
There are two encoding settings that get into the action when you develop your app:
First, there is encoding used to edit the file. However, for the app running, text is just a sequence of bytes; it needs to know how to interpret it.
U++ is basically Unicode/UTF-8 system (most of internal processing ends as unicode). Anyway, as in the real life things are never as simple (e.g. we have to maintain legacy apps in Win-1250 , you can set the "default charset" and most string literals are then converted from it (somewhere in DrawText).
Long story short, please try
SetDefaultCharset(CHARSET_WIN1251)
I guess you will also need set the language, so you can do both using
SetLanguage(LNGC_('R', 'U', 'R', 'U', CHARSET_WIN1251));
BTW, maybe even better is to stay with utf-8, which is "default default encoding", as long as you are not concerned with "external" troubles.
Mirek
[Updated on: Sat, 05 August 2006 17:06] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 26 00:30:33 CEST 2025
Total time taken to generate the page: 0.00793 seconds
|
|
|