How to Display Unicode Characters in Executable

Post here wxCrafter related issues / features / bugs
ColleenKobe
CodeLite Expert
Posts: 104
Joined: Wed Mar 30, 2016 4:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

How to Display Unicode Characters in Executable

Post by ColleenKobe » Fri Jun 02, 2017 8:27 pm

I need to graphically allow my user to enter the coefficients of a polynomial equation. I'm having trouble displaying a multiplication sign and a superscript on the screen.

I tried a number of solutions that ended up either being too much work, or just didn't work. For example, I created a graphic image and placing the wxStaticText fields on the image in the appropriate places; I tried to make separate wxStaticText fields align high enough to show that the number was a superscript; etc.

My final solution was to simply incorporate the correct extended character set characters that I needed into the text string in wxStaticText. As you can see in the printscreen below, the multiplication sign and superscripts appeared perfectly in the wxCrafter screen and in the wxCrafter Preview screen, but in the actual executing code, the special characters were replaced by extended characters.

The Unicode values of these characters appear in https://en.wikipedia.org/wiki/Unicode_s ... perscripts. I'm mainly looking for the superscripts of 0..9, and also the multiplication sign (U + 00D7).

What do I need to do to display my Unicode characters correctly in the executing code?

Thanks!
  • Software Versions
    CodeLite 10.0.4
    gcc 4.9.3
    tdm-gcc 5.1.0.2
    Windows 10 Pro, 64-bit
    wxWidgets 3.1.0
    wxCrafter 2.6

    Target platform 32-bit
    Target build debug
You do not have the required permissions to view the files attached to this post.

User avatar
eranif
CodeLite Plugin
Posts: 5895
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to Display Unicode Characters in Executable

Post by eranif » Fri Jun 02, 2017 8:36 pm

By default, all strings generated by wxCrafter (for C++ code) are wrapped with the "_" macro, this is done so the strings will be translatable using external tools (po files)
This also means that the strings are also going through some conversion, to avoid this conversion, you need to tell wxCrafter to wrap the string with the wxT() macro instead.
This is done by selecting the top element the wxCrafter tree view and setting the value for "Generate translatable strings" to "False"
wxc.png
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread

ColleenKobe
CodeLite Expert
Posts: 104
Joined: Wed Mar 30, 2016 4:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to Display Unicode Characters in Executable

Post by ColleenKobe » Sun Jun 04, 2017 9:33 pm

Thank you for your prompt reply, eranif.

I'm so sorry, but how do I get to the wxCrafter tree view? Is that the view on the left? If so, how do I get the display you show in your reply to appear?

Or maybe I don't have the correct tab downloaded? See my printscreen below.

Colleen
You do not have the required permissions to view the files attached to this post.

User avatar
eranif
CodeLite Plugin
Posts: 5895
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to Display Unicode Characters in Executable

Post by eranif » Sun Jun 04, 2017 10:21 pm

Just change the "Generate translatable strings" to "false" ( you can see it on the far right in your screenshot)
Make sure you have read the HOW TO POST thread

ColleenKobe
CodeLite Expert
Posts: 104
Joined: Wed Mar 30, 2016 4:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to Display Unicode Characters in Executable

Post by ColleenKobe » Mon Jun 05, 2017 3:51 pm

OH! Got it. How could I not see that??? THANK YOU, eranif!!!

I'm in the middle of incorporating a major change, so it'll be a while before I can
compile and run again. But I'm sure the edit you gave me will work. Thank you so much!

Colleen

Post Reply