Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
hojtsy is currently offline  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 #936 is a reply to message #932] Thu, 09 February 2006 17:46 Go to previous messageGo to next message
riri is currently offline  riri
Messages: 18
Registered: February 2006
Location: France
Promising Member
Hi

Are you sure the file is in the correct charset encoding ?
I've found many reports for the same problem, and bad file encoding was the trick.
Re: some non-english characters don't display [message #1302 is a reply to message #936] Sun, 26 February 2006 20:29 Go to previous messageGo to next message
dr_jumba is currently offline  dr_jumba
Messages: 24
Registered: February 2006
Location: Ukraine
Promising Member
I have the same problem with non-Latin symbols (cyrillic). Selecting the right encoding Setup->Environment->Editor doesn't help.
Build 602beta4, OS FreeBSD 6.0
Re: some non-english characters don't display [message #1303 is a reply to message #1302] Sun, 26 February 2006 20:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
Registered: November 2005
Ultimate Member
At least on Linux, there is another issue - widely used fonts (e.g. Bitstream Vera) do not contain required unicde characters. Other toolkits hide this fact by picking required characters from other fonts. We will fix this issue asap (probably by synthetising missing chars).

Of course, it this is the case, you would see "boxes" instead of characters. If this is not true, we will do further investigations...

(FreeBSD in in early stage of support. It is possible that IM behaves differently).

Mirek
Re: some non-english characters don't display [message #1313 is a reply to message #1303] Mon, 27 February 2006 21:31 Go to previous messageGo to next message
dr_jumba is currently offline  dr_jumba
Messages: 24
Registered: February 2006
Location: Ukraine
Promising Member
When I use 'Courier New' font in ide I can see cyrillic characters in files if those chars are inserted in 3rd party editor. When I use e.g. 'Courier' I see boxes.
But in no way I can input cyrillic chars in upp applications (have tried in ide and in AddressBook).
Re: some non-english characters don't display [message #1314 is a reply to message #1313] Mon, 27 February 2006 21:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
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 #1315 is a reply to message #1314] Mon, 27 February 2006 22:09 Go to previous messageGo to next message
dr_jumba is currently offline  dr_jumba
Messages: 24
Registered: February 2006
Location: Ukraine
Promising Member
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.
Re: some non-english characters don't display [message #1317 is a reply to message #1315] Mon, 27 February 2006 22:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
Registered: November 2005
Ultimate Member
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
Re: some non-english characters don't display [message #1320 is a reply to message #1317] Mon, 27 February 2006 22:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
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 #1441 is a reply to message #1320] Sat, 04 March 2006 00:01 Go to previous messageGo to next message
dr_jumba is currently offline  dr_jumba
Messages: 24
Registered: February 2006
Location: Ukraine
Promising Member
In

				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 have changed XmbLookupString to Xutf8LookupString and now I am happy user, who can type in cyrillic symbols!!!!!

Laughing Laughing Laughing
Re: some non-english characters don't display [message #1442 is a reply to message #1441] Sat, 04 March 2006 00:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
Registered: November 2005
Ultimate Member
Actually, I wanted to use Xutf8LookupString originally, but there is quite a lot of warnings over the net about this function...

Anyway, looks like the most straighforward way now. I am changeing the code to it now Wink

Mirek
Re: some non-english characters don't display [message #1443 is a reply to message #1442] Sat, 04 March 2006 00:18 Go to previous messageGo to next message
dr_jumba is currently offline  dr_jumba
Messages: 24
Registered: February 2006
Location: Ukraine
Promising Member
Quote:


Actually, I wanted to use Xutf8LookupString originally, but there is quite a lot of warnings over the net about this function...



What are the warnings?
Re: some non-english characters don't display [message #1447 is a reply to message #1443] Sat, 04 March 2006 07:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
Registered: November 2005
Ultimate Member
dr_jumba wrote on Fri, 03 March 2006 18:18

Quote:


Actually, I wanted to use Xutf8LookupString originally, but there is quite a lot of warnings over the net about this function...



What are the warnings?


Try google Wink

Mirek
Re: some non-english characters don't display [message #1448 is a reply to message #1447] Sat, 04 March 2006 12:21 Go to previous messageGo to next message
dr_jumba is currently offline  dr_jumba
Messages: 24
Registered: February 2006
Location: Ukraine
Promising Member
Have tried.
Most of materials I have found are posted more than couple of years ago. May it is not an issue today.
Re: some non-english characters don't display [message #1451 is a reply to message #1448] Sat, 04 March 2006 13:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
Registered: November 2005
Ultimate Member
dr_jumba wrote on Sat, 04 March 2006 06:21

Have tried.
Most of materials I have found are posted more than couple of years ago. May it is not an issue today.



I agree.

Mirek
icon9.gif  Re: some non-english characters don't display [message #4387 is a reply to message #932] Fri, 04 August 2006 13:31 Go to previous messageGo to next message
Raygun is currently offline  Raygun
Messages: 3
Registered: August 2006
Junior Member
Umm.. guys..
Please help a newcomer Sad

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 #4390 is a reply to message #4387] Fri, 04 August 2006 13:48 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
Raygun wrote on Fri, 04 August 2006 12:31


...
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.
...



What if you try Menu->Project->Package Organizer.
And in that window: top-right ->Encoding (selector)?
It helped me to display russian...
I can't remember what else I used...
icon9.gif  Re: some non-english characters don't display [message #4391 is a reply to message #4390] Fri, 04 August 2006 14:16 Go to previous messageGo to next message
Raygun is currently offline  Raygun
Messages: 3
Registered: August 2006
Junior Member
fudadmin wrote on Fri, 04 August 2006 14:48


What if you try Menu->Project->Package Organizer.
And in that window: top-right ->Encoding (selector)?
It helped me to display russian...
I can't remember what else I used...


Nope, didn't work. Encoding was set to 'Default', and I believe that default is CP-1251, because that's what I have set in Setup -> Environment -> Editor -> Default charset.

Anyway, nothing changed after I went to Menu->Project->Package Organizer and changed encoding from 'Default' to 'Windows 1251'
(and launched 'Rebuild All' afterwards, most certainly)..
Crying or Very Sad
Re: some non-english characters don't display [message #4399 is a reply to message #4391] Fri, 04 August 2006 22:48 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
Raygun wrote on Fri, 04 August 2006 13:16


...
Nope, didn't work. Crying or Very Sad


I've just checked that I was happy when I had russian text in ArrayCtrl from my database.


Is this a bug or some tricks are needed for labels?
Re: some non-english characters don't display [message #4409 is a reply to message #4391] Sat, 05 August 2006 17:04 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 12122
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 Smile, 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

Previous Topic: Code that needs to be internationalized
Next Topic: How to display several languages without translation files?
Goto Forum:
  


Current Time: Wed Dec 11 02:02:29 CET 2019

Total time taken to generate the page: 0.02145 seconds