Hello ;)
wxSmith is a great Tool, but if i use an umlaut like "°C" in a dialog i get this:
(http://www.directupload.net/images/060802/temp/8FOwK7Hz.jpg) (http://www.directupload.net/show/d/777/8FOwK7Hz.jpg)
I wanted to compile with unicode enabled, but there i get errors with every string in the code.. I don't know why. How can i fix this problem?
Thanks in advance, Stefan
Quote from: geronet on August 02, 2006, 06:17:19 PM
I wanted to compile with unicode enabled, but there i get errors with every string in the code.. I don't know why. How can i fix this problem?
There is a nice article on how to prepare wxWidgets code for unicode e.g here: http://www.wxwindows.org/manuals/2.6.3/wx_unicode.html (http://www.wxwindows.org/manuals/2.6.3/wx_unicode.html). Keep in mind that you have to compile the wxWidgets lib(s) for unicode, too and setup your C::B project appropriately (or use the wizard to create a stub for you).
With regards, Morten.
And what should i do without unicode?
Quote from: geronet on August 03, 2006, 05:57:02 PM
And what should i do without unicode?
I thought your intenetion was to compile unicode. I wonder why you want to design yyour application in ANSI. Does this becasue you have to be compatible to Win9x or similar? Otherwise I'd suggest you start with unicode right from the start...?!
If you want ANSI you could try to use the ASCii code instead, maybe?!
Hmmm... now I wonder: I used the wizard to create a wxWidgets ANSI application and changed the "About" message to:
wxMessageBox(msg, _("Welcome to °C"));
I get a message as attached - thus: This actually works! I'm not sure what you're doing wrong. What's your sys config? (Mine is WXP-SP2, German).
With regards, Morten.
[attachment deleted by admin]
I have WinXP SP2 (German), the latest C::B and gcc.
If i change the text label from the program with
StaticText3->SetLabel(_T("°C"));
it is correctly displayed, but that's not a solution.
In the .xrc it is also correct:
<label>°C</label>
Any Suggestions? (perhaps in German?) ;)
If i try to compile with unicode enabled, i get a lot of errors with every string:
main.cpp:213:1: converting to execution character set: Illegal byte sequence
Line 213:
wxMessageBox(_T("Konfigurationsdatei ist beschädigt!"), _T("Fehler"));
The problem is the "ä", if i delete it the error is gone...
I'm stuck now. If i compile in ANSI mode, i get dialogs like shown in the first post.
If i compile in unicode mode, i get errors because of the char '°' in the string shown here:
Textfield[i]->SetLabel(wxString::Format(_T("%.1f°C"), *(T[i].value)));
And now? I don't know..
Quote from: geronet on August 04, 2006, 10:29:39 PM
I'm stuck now. If i compile in ANSI mode, i get dialogs like shown in the first post.
If i compile in unicode mode, i get errors because of the char '°' in the string shown here:
Textfield[i]->SetLabel(wxString::Format(_T("%.1f°C"), *(T[i].value)));
And now? I don't know..
Are your source files using an ANSI encoding? If so, try using UTF-8.
Textfield[i]->SetLabel(wxString::Format(_T("%.1f\x00B0C"), *(T[i].value)));with the help of the chart
http://www.unicode.org/charts/PDF/U0080.pdf
displays the character correctly on Linux, with msw i get some undefined character.
Maybe the cpp-file on Windows is ANSI? How can i change that?
On Linux i get
Quotefile main.cpp
main.cpp: ISO-8859 C program text, with CRLF, LF line terminators
It's ok now, i converted the file to utf-8 with "iconv -f ISO-8859-1 -t UTF-8 main.cpp" and now i have to insert the character
Textfield[i]->SetLabel(wxString::Format(_T("%.1f°C"), *(T[i].value)));
and it displays correctly ;)
PS: The C:B Editor doesn't show the correct character, it is displayed like here (two bytes, one A with ^on it and a °), but C:B is compiled with unicode enabled?!
Did you try Edit->File encoding->UTF-8?
Ah, that's it :D
Didn't see that menu.. Thanks a lot.