Joel
Joel

Reputation: 2035

wxWidgets string on windows

I have this code:

wxString tmp(wxT("Información del usuario"));
wxStaticBoxSizer* sbSizer1 = new wxStaticBoxSizer (wxVERTICAL, panel, tmp);

This shows rare symbols instead of ñ in Windows but in Linux it shows correctly the letter..any ideas?

Upvotes: 1

Views: 152

Answers (1)

VZ.
VZ.

Reputation: 22688

The value of the string in your code depends on the encoding of your source file and also the charset used by your compiler. If your source file itself is in Unicode (whether it's UTF-8 or UTF-16), then you can use L"..." to create a wide string literal. If not, or you're not sure, you can always use wxString::FromUTF8() to explicitly encode the string as UTF-8, e.g. wxString::FromUTF8("Informaci\xc3\xb3n...") will always work.

Upvotes: 2

Related Questions