LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI and EXE with Special characters not working

Hello all,

  

I am facing a problem with inserting Copyright symbol for our project.

 

I am working on a project where we include Copyright symbol `©` in few String indicators for displaying copyright information.

 

I tried including both ‘©’ symbol as well as its Hex Code ‘\A9’ in a string constant for display.

 

When testing the code as VI as well as EXE in another PC, the copyright symbol was displayed as unidentified symbol as shown in the image in attachment.

 

I tried 'UseUnicode = TRUE' in LabVIEW.ini file method. This was not working.

 

I tried Unchecking 'Beta: Use Unicode UTF-8 for Worldwide Language Support' option in Region Settings of Change System Locale option in Control Panel. This fixed the problem but We want the solution to be scalable and programmatical method without manual interaction.

  

I would like to understand the reason and solution if possible.

0 Kudos
Message 1 of 6
(2,278 Views)

Hi Aajay,

 

for me this works as expected:

I guess this depends on the used font encoding by Windows: my computer is set to use the 1252 codepage (WesternEuropean)…

 

Btw. when using strings/numerics in a different display format you should always set the display style indicator visible!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(2,273 Views)

Separately from 'UseUnicode = TRUE' (which you need), there is a text property "Interpret as Unicode".  This property applies character-by-character (like font attributes), and is applied only to selected text.

Run this code one time to set a string indicator to Unicode

uc.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 6
(2,225 Views)

I have the \A9 code in my programs without using UNICODE. I have not seen a problem with it yet. I would follow up on GerdW's suggestion and see what font encoding the OS is using.

 

mcduff

0 Kudos
Message 4 of 6
(2,216 Views)

I don't know if it's changed any, but when I used the unofficial Unicode support back in LV 2012, it was like letting the genie out of the bottle.  You have to be VERY careful with how you use it, because it had a tendency to cross boundaries and start affecting controls and VIs that don't have it enabled, and watch out especially if you happen to use an Unicode-enabled VI or control in a project that it is not enabled in.  It can mess up your project in ways that can't be undone.

 

it's been so long since I messed with it though, that I can't remember what happens.  I just know some of the changes can't be reversed.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 6
(2,207 Views)

The problem is twofold. First the Windows codepage defines the actual character set used for a particular system. Not every codepage contains the copyright symbol. Then there comes the font. A font can have support for one or several codepages. If it doesn't support the codepage your system uses then it will display characters with its default (or only supported) codepage. So setting the right codepage for your system that supports this character is the first step. Then choosing a particular font for the text display can make that specific character visible or not.

 

You can usually set the font to use for a control, of course if you use non-standard fonts it could be that the target system doesn't have that font. Which font the Windows font substitution system will then use is up to anyone's guess. The codepage you can also theoretically control but that is a very intrusive system change. If your software tries to do that without explicit user consent, you are sure to get the worst application ratings possible, faster than you can blink your eye.

 

Unicode support in LabVIEW hasn't changed in 10 years anything. It is experimental at best. The Windows Beta feature to use Unicode support as codepage selection works actually better, but it is in Beta since Windows 7 and for a reason!

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 6
(2,192 Views)