Page 1 of 1

How to Display Unicode Characters in Executable

Posted: Fri Jun 02, 2017 8:27 pm
by ColleenKobe
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

Re: How to Display Unicode Characters in Executable

Posted: Fri Jun 02, 2017 8:36 pm
by eranif
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

Re: How to Display Unicode Characters in Executable

Posted: Sun Jun 04, 2017 9:33 pm
by ColleenKobe
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

Re: How to Display Unicode Characters in Executable

Posted: Sun Jun 04, 2017 10:21 pm
by eranif
Just change the "Generate translatable strings" to "false" ( you can see it on the far right in your screenshot)

Re: How to Display Unicode Characters in Executable

Posted: Mon Jun 05, 2017 3:51 pm
by ColleenKobe
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