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 » ArrayCtrl, HeaderCtrl & GridCtrl » [SOLVED] ArrayCtrl and German characters
[SOLVED] ArrayCtrl and German characters [message #33642] Sat, 03 September 2011 13:54 Go to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I have a one column arrayctrl in which I add a row with this string:

"10102","1030","","Luigi,Fürlano","M","D","1968", "201119","2390","122","2439","IM","4614186","GER "

Because of the U with '..' on its roof the ctrl displays only

"10102","1030","","Luigi,F

The same happen with a columnlist. Is there a way to prevent it?
My app is set to be encoded in UTF8 in Main Package Configuration. Language is set to
SetLanguage( LNG_('D','E','D','E') );
I use
SetDefaultCharset(CHARSET_UTF8);
at the start of the program. Do I need to do something else?

Thanks,
Luigi

EDIT: I used ToSystemCharset(str) before to add the string str. Now I can see the whole string and not part of it, but on my Italian system the German "umlauts" are displayed with a silly '?'.
Who knows if on a German windows the original character will come back... Rolling Eyes I was told no by one of my user.

EDIT2: the umlaut are shown correctly in the GUI if the string is native of my application. The problem seems to be in the external text file containing the data and made in Germany. Wordpad show correctly the umlaut but when the data come in my app (in arrayctrl for example) happen one of these two things:
1) the record is hided from the umlaut up to end;
2) if I use ToSystemCharset(record) the record is visible but with '?'.
In case one want to see how this file data is done it is freely available online (spieler.csv)
http://www.schachbund.de/dwz/db/download/LV-0-csv.zip

[Updated on: Tue, 06 September 2011 12:58]

Report message to a moderator

Re: ArrayCtrl and German characters [message #33671 is a reply to message #33642] Mon, 05 September 2011 11:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Apparently, the source .csv is in Win-1252 encoding, which is something U++ has zero chance to know...

You have to convert from Win1252 to utf-8.

ToCharset(CHARSET_UTF8, text, CHARSET_WIN1252);

should do the job...

Mirek
Re: ArrayCtrl and German characters [message #33672 is a reply to message #33671] Mon, 05 September 2011 12:43 Go to previous message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
mirek wrote on Mon, 05 September 2011 11:31

Apparently, the source .csv is in Win-1252 encoding, which is something U++ has zero chance to know...

You have to convert from Win1252 to utf-8.

ToCharset(CHARSET_UTF8, text, CHARSET_WIN1252);

should do the job...

Mirek


After converting the file it work!

String ss, s = LoadFile("spieler.csv");
ss = ToCharset(CHARSET_UTF8, s, CHARSET_WIN1252);
SaveFile("spielerNEW.csv", ss);

Thanks,
Luigi

[Updated on: Tue, 06 September 2011 12:59]

Report message to a moderator

Previous Topic: GridCtrl: master - detail
Next Topic: GridCtrl compilation error in version 3878
Goto Forum:
  


Current Time: Thu Mar 28 12:29:58 CET 2024

Total time taken to generate the page: 0.01387 seconds