[wxGTK] - wxString containing special characters. Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Earned some good credits
Earned some good credits
Posts: 111
Joined: Mon Apr 24, 2017 4:23 am

[wxGTK] - wxString containing special characters.

Post by tomay3000 » Wed May 02, 2018 7:26 pm

I have a little wx project which works perfectly under Windows, but when I have changed the development platform "Linux mint 18.3 x64" and "Code::Blocks svn 11362", to test it there, the code compiles without problems BUT strings containing special characters like this one:

Code: Select all

"À &propos...\tF1"
or this one

Code: Select all

"Afficher les informations à propos de cette application"
wont appear in the application at all in addition to the message box assertions that wx generates.
take a look at the following screenshots to understand what I mean:
Screenshot from 2018-05-02 07-36-38.png
Screenshot from 2018-05-02 07-36-38.png (5.11 KiB) Viewed 553 times
Screenshot from 2018-05-02 01-44-42.png
Screenshot from 2018-05-02 01-44-42.png (59.79 KiB) Viewed 553 times
Screenshot from 2018-05-02 01-42-28.png
Screenshot from 2018-05-02 01-42-28.png (56.9 KiB) Viewed 553 times
But when I add the L unicode letter before the string literals explicitly like this:

Code: Select all

L"À &propos...\tF1"
, every thing works perfectly (but it is not good practice to do so because in wxMSW it works without it).

What is the problem of this situation?
How can I solve it?

Thank you for your understanding.
Last edited by tomay3000 on Wed May 02, 2018 8:06 pm, edited 1 time in total.

Part Of The Furniture
Part Of The Furniture
Posts: 3087
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: [wxGTK] - wxString containing special characters.

Post by ONEEYEMAN » Wed May 02, 2018 7:49 pm

Adding the "L" in front of the string is a good practice for Unicode string.
The code will work in Windows as well.

Thank you.

Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 660
Joined: Mon Apr 30, 2012 11:07 pm

Re: [wxGTK] - wxString containing special characters.

Post by Manolo » Thu May 03, 2018 3:36 pm

Post Reply