11-22-2021 07:07 AM
Hi I've been try to update a label takes text to one that displays text and a special character. The character being the dc symbol ⎓. I have LabVIEW set to Unicode = true.
The full string i have in the text box is RX CLASS 2 5v ⎓ 1A, but when I print i get RX CLASS 2 5v '# 1A, I've tried the format of the text box but nothing changes. I derived the symbol by using word and typing 2393 ALT x then put the symbol in notepad.
Could someone give me any pointers on this
Solved! Go to Solution.
11-23-2021 08:11 AM
You need the NI Unicode VIs:
LabVIEW Unicode Programming Tools - Discussion Forums - National Instruments
11-23-2021 08:43 AM
Just be aware that using Unicode in your code is unsupported, and for good reason. I've seen the Unicode setting destroy VIs not meant to have Unicode in an irreversible way. All you have to do is open a VI with Unicode in it and then open one that doesn't need it and you could be fetching an old version from your SCC shortly.
11-23-2021 10:57 AM
In addition to the UseUnicode="True" setting in labview.ini, the text attribute "Interpret As Unicode" must be set to true. Note that this is like other attributes in that it can be applied chr by chr. When you use the property , it only applies to the selected text, not the entire string. See attachments
11-24-2021 02:52 AM
Thanks zou billko for the great info and thanks to paul_cardinale for the vi's this looks like what I'm after , i need to check the fonts on the printer can handle the graphics.
thanks again
11-29-2021 06:17 AM - edited 11-29-2021 06:18 AM
Hi Paul, Sorry to reopen a solved page (not sure if it should be a new post?) with regards to the software example you supplied that looked to be bang on , an issue I believe I'm having now is the printer (intermec pc43t) I believe only accepts 8 bit utf encoding and the out put of the vi is 16bit. Printer is ok up to LATIN SMALL LETTER Y WITH DIAERESIS (U+00FF) but falls over at LATIN CAPITAL LETTER A WITH MACRON (U+0100) and above. for testing i was using the copyright symbol U+00A9 and the dc symbol U+2393. Is this code able to convert to 8 bit utf. I tried converting to 8 bit but have struggled with it. i was looking to try the utf 8 coding below
UTF-8 Encoding: | 0xE2 0x8E 0x93 |
UTF-16 Encoding: | 0x2393 |
any help would be appreciated
11-29-2021 07:02 AM
Attached find my (still very incomplete) Unicode library.
The functions you will most likely find useful are:
Note however that strings constructed with the functions I previously posted will most likely result in text that is not purely UTF-16, but rather a combination of ASCII and UTF-16.
11-29-2021 08:25 AM
Hi Paul thanks for the collection there's a lot to learn there, I've tried to amend the 16 bit to 8 bit using the
UTF-8 Encoding: | 0xE2 0x8E 0x93 |
regards
ian
11-29-2021 10:20 AM
@ianchisholm wrote:
Hi Paul thanks for the collection there's a lot to learn there, I've tried to amend the 16 bit to 8 bit using the
- Code Points to UTF-8.vi but no joy I don't think I'm understanding the format of using the 16 bit unicode 2393...
- and the 8 bit
does the 8 bit have to use the three hex values?. ive attached a screen shot of what i was tring to do
UTF-8 Encoding: 0xE2 0x8E 0x93 regards
ian
The VIs do what there names imply:
UTF-8 can have 1, 2, 3, or 4 bytes per character, depending on the specific code point.
Note: Post VIs, not pictures. No one will try to debug a picture.