Unicode with wxwidgets ... Help me, please !!! Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
thanhnh
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Dec 01, 2009 11:20 am

Unicode with wxwidgets ... Help me, please !!!

Post by thanhnh » Tue Dec 01, 2009 7:28 pm

I'm a new bie.

Today, I've built wxwidgets 2.9.0 as follow:

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release clean

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=debug

I use Codeblocks ( wxSmith ) to create a new wxwidgets project. I typed some labels and button's text in Unicode format ( I'm Vietnamese ). However, when I run my program, button's text doesn't appear correctly. And I want to ask all of you: How can I use Unicode fonts in wxwidgets programs ? Please help me, thanks alot :)

( srr, because my English is too bad :( )

catalin
Moderator
Moderator
Posts: 1526
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Post by catalin » Tue Dec 01, 2009 11:24 pm

In C::B go to Settings->Editor...->General Setting
What do you have for "Default encoding when opening files" ?

The way that works for me:
Set the above field to UTF-8 (so that source files will all be utf-8 encoded).
Then, when writing real text in the sources (at least when using characters out of ASCII range) do something like this:
wxString text = wxString::FromUTF8("test ăîâșț ĂÎÂȘȚ 言語"); // ...I don't understand the Kanji characters, I hope they're not offending.. :)

thanhnh
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Dec 01, 2009 11:20 am

Post by thanhnh » Wed Dec 02, 2009 2:17 am

Many thanks to you ^^

Post Reply