From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-28-2017 01:30 PM
Is it possible to combine Chinese and English text in a string and write it to a file? I have a vi that creates an XML file, we want to add support for Chinese characters. I've got the Chinese characters working now but when I concatenate it with English text it changes all the text to Chinese.
08-28-2017 07:11 PM
Is it a manual XML write or a premade XML routine? If it's manual, can you write the text as 3 separate strings?
Also, maybe try using the "String to byte array" node, then concatenate all 3 arrays, then convert back to a string?
(I don't have support for Chinese set up so I can't test it myself...)
08-28-2017 07:45 PM
Chinese character uses 2 bytes, while ASCII is single byte. You have to convert ASCII to multi-byte first.
Take a look unicode:
https://forums.ni.com/t5/Reference-Design-Content/LabVIEW-Unicode-Programming-Tools/ta-p/3493021
08-29-2017 03:10 AM
As mentioned you need to buffer the constant to unicode by adding a \00 in front of every character. The easist way would be to convert the text to a U8 array and convert that to a U16 array, typecast to string and add to the chinese string.
/Y
04-25-2018 09:58 AM
Hi,
Here is an article that goes through how to concatenate English and Chinese characters into the same string. Unfortunately, LabVIEW does not fully support Unicode, so not entirely sure if it's possible to write this to a file. But if this is something that is important, LabVIEW NXG versions actually supports Unicode, so this may be a good option for this.
Parul M.
Applications Engineer
National Instruments