LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read/Write file in Unicode (UTF-16)

Solved!
Go to solution

Hi, I have some issue to write a file in Unicode (UTF-16)

 

I have to read a file with LabView, change some parameters and write the new data into the same file. The file uses Unicode UTF-16.

 

I downloaded some library here: https://decibel.ni.com/content/docs/DOC-10153

 

I can read the file, convert the data to UNI/ASCII/UNI, and then write the file. But when I open the new file with an editor like Notepad++ there are some unexpected characters at the end of the line.

 

Even reading the file and writing exactly the same data doesn'not work.

 

I attached an example.

 

Thanks for you kind support.

 

 

0 Kudos
Message 1 of 5
(5,760 Views)

Any idea?

0 Kudos
Message 2 of 5
(5,744 Views)
Solution
Accepted by topic author logatto

Right-click on your Read and Write Text File functions.  There is an option to "Convert End Of Line".  Turn that off on both functions.

 

As a side not, you don't need the Close File functions.  The Read and Write Text File functions will close the file if the file reference output is not wired.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(5,739 Views)

No chance to look at any of your code but problems like this are almost always, and by almost always I mean always caused by using Write to Text File with the default option of Convert EOL selected.

 

Assuming this is true (I am 99.9% sure that it is), simply right-click the function and deselect the Convert EOL option.

 

Edit (seeing the above post make that 100.0% sure)

0 Kudos
Message 4 of 5
(5,738 Views)

It was really stupid.

 

I was searching the EOL everywhere and it was under the right-click butto!

 

Thanks

0 Kudos
Message 5 of 5
(5,730 Views)