ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading UTF-8 Files in Labview

I need to read UTF-8 encoded files to display Chinese and Korean charaters I have fonts to display then and the files display correctly in notepad but loads garbage in Labview 8.0.1 can the Read Text File be configured to read UTF-8 encoding or is there another Vi that will work?

 

This is for a Multilingual App the needs to dynamically switch between English, Spanish, Chinese, and Korean when running not just when installed.

0 Kudos
Message 1 of 8
(9,990 Views)

SWEng21,

 

If you aren't using XP, you can take a look at this thread, which provides some user vi's to decode most of unicode, but may have problems with special characters.

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
Message 2 of 8
(9,955 Views)

Thanks Rob_K,

 

Unicode will work, I can read the data and display it in strings, button text, and captions for each language.

 

Can I display unicode text in the window title?  I have not been able to get text rings, menu rings, or Comboboxs to display unicode text consistantly even when I use version 8.5.1.
0 Kudos
Message 3 of 8
(9,945 Views)

LabVIEW is natively ANSCII, so I believe it is not available in rings since they point to actual references.  If there is a way, I am not aware of it.

 

I have got it to work in string displays and captions, as you have mentioned.

 

If you really needed a workaround, you could probably create a custom control with string indicators as the scrolling options...that would actually be impressive if you could make it work, but it would take a bit of effort.

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 4 of 8
(9,922 Views)

Thanks, 

I can live with the ring and combo box in ASCII I have already made a Vi for conversions from Unicode to ASCII to display text from the Unicode file for these.

 

I also realized that none of the supplied Dialog pop up boxes can display Unicode text so I am creating custom Vis to workaround this also. This would be nice to have in future versions of LabView.
0 Kudos
Message 5 of 8
(9,917 Views)
I am using Tabs and have set it to allow the captions to change but I do no see how to force/use unicode for the tab captions. The customer requires that tabs and text rings to be unicode compliant for Chinese and Korean.  Is there a way to make these work  in Labview??
0 Kudos
Message 6 of 8
(9,879 Views)

SWEng21 wrote:

Thanks, 

I can live with the ring and combo box in ASCII I have already made a Vi for conversions from Unicode to ASCII to display text from the Unicode file for these.

 

I also realized that none of the supplied Dialog pop up boxes can display Unicode text so I am creating custom Vis to workaround this also. This would be nice to have in future versions of LabView.

Agreed. I have talked with some R&D folk about this, but feel free to also submit a product suggestion from our website.

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 7 of 8
(9,870 Views)

For reading (and writing) UTF-8 encoded files see the VI attached to this message:

http://forums.ni.com/t5/LabVIEW/undocumented-function-quot-text-to-utf-8-quot/m-p/1034616#M460673

 

Greetings,

shb

0 Kudos
Message 8 of 8
(9,204 Views)