LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String indicator and accented character

Solved!
Go to solution

Good day to all of you,

 

I was triyng to display an italian text to a string indicator and incountering some visualization problem. Italian language often use accented character and labview found this one visualized ina a strange manner. 

 

example.jpg

 

the red one is the "può" and the green one is the "é" character. 

 

How can I avoid this mess?

 

Thank you very much,

 

Francesco

 

P.S.

Labview is the 2018 version and the OS is windows 10.

0 Kudos
Message 1 of 6
(3,772 Views)

You can probably avoid this mess. But it's not clear how you got into it in the first place.

 

Can you type those characters (and see them correctly)? Then LabVIEW is capable of showing them.

 

But what you are showing seems to originate from a file. This file (even a txt file) can be encoded in several ways. If it doesn't match LabVIEW's encoding (MBSC), you get weirdness...

Message 2 of 6
(3,736 Views)

Just to elaborate a bit (it's not easy stuff)...

 

To display a character in LabVIEW, you need:

+ MBSC byte(s) that represent the character in a code page

+ The correct code page to convert it to Unicode.

+ A font that supports the Unicode character.

 

The tick in your case is probably the first. If the file is stored as Unicode, LV will show it as MBSC. That won't work. But even if the file has MBSC data, the character displayed by LabVIEW can be different, depending on the code page you're in.

 

There are ways to convert MBSC to Unicode, but the other way around is not always possible, as code pages don't support all Unicode characters (which is the reason code pages exist in the first place).

 

This will probably all get a lot easier in NXG, which supports Unicode. Although there are numerous Unicode encodings 😁.

0 Kudos
Message 3 of 6
(3,730 Views)

Hi!

As written in the previous answer, it depends on what encoding is used for the source. I guess your text comes from a file.

 

This is just a try.

I have saved your text in a UTF8-encoded text file, and loaded it with LV.

The original text also has some strange characters in it, though only for the first, it's the same as in your example.

 

There is an undocumented "UTF-8 to text" VI, which is part of LabVIEW, which does the trick.

However, I don't know where this VI is located, just found it in a VI on the web.

And as always with undocumented functions, they may disappear without notice in a future version.

 

Text.png

Message 4 of 6
(3,720 Views)
Solution
Accepted by topic author FM82

Thank you guys,

 

you are right; I downloaded and installed the  NI Unicode Tools from VIPM and use the conversion function from UTF8 to Labview and now it works perfectly.

 

Thanks again,

 

Francesco

Message 5 of 6
(3,707 Views)

Saving as UTF-8 is a way out.

 

If you can't change the file, you're in trouble. There's UTF-8, 16, 32, big endian and little endian. Notepad only supports a few, notepad++ has more. Manually converting the file isn't trivial, but doable.

 

EDIT: That crossed.

0 Kudos
Message 6 of 6
(3,705 Views)