Jump to content

LV text rendering, MBCS, OS, Unicode


Recommended Posts

Cross post from NI forums.

https://forums.ni.com/t5/LabVIEW/LV-text-rendering-MBCS-OS-Unicode/td-p/3740140

This translation topic keeps coming back to me from time to time when I was asked to provide multilanguage UI for Chinese and Eng. 

I have the problem in understanding how LV is rendering strings.

So far I understand (I hope I do) that Windows uses unicode UTF16. In LV we do not have Unicode support and (we have some private functions but using them is too much pain) uses MBCS so we need codepage to tell how string needs to be rendered. In Windows we can set system locale that will tell non Unicode apps how to render strings?

 

Assuming all that i have a problem understanding why this is displayed:

 

large.png

 

It should display exactly what is on this codepage? If not can someone explain why it shows this results and some random digits at the end?

 

Unicode strings can be converted to multibyte based on given codepage by using

WideCharToMultiByte and MultiByteToWideChar.

 

Assuming I have something written in russian/chinese (Unicode) we can convert that to MBCS based on codepage and display correctly for valid codepage in the system?

 

I have looked at LV error files and they are stored in utf8 for xml files, so some sort of conversion must occur inside LV to correctly display this data?

txt encoding of error files varies (at least that is what notepad++ is saying), for Chinese txt we have GB2312, when system locale is set to China I assume this coding will be used to render text in LV?

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.