02-22-2024 06:11 AM
Hello, I am using Read from text file to read a text in Spanish. The problem is when there is a "tilde", that is a special character to make the accent. The text is something like this:
Identificación de la producción
And I get
IdentificÃ3 n de la producciÃ3 n. It sometimes change also to Ã-. What should I do?
Solved! Go to Solution.
02-22-2024 07:34 AM
I tried the following "experiment" -- I captured your string "Identificación de la producción", pasted it into a LabVIEW 2021 (32-bit) String constant, and then wrote the following small program:
When I ran it, it produced a Text file that I named "Spanish accents.txt" and that contained "Identificación de la producción" (I copy/pasted the text into the pair of quotation marks).
But here's the thing -- it depends on what editor I use to look at the file. I have several text editors on my PC. One is extremely old -- maybe >40 years (and no longer available), while the (including Notepad++) are still being maintained. The "old" editor returned the symbol "less than or equal" (which I'm not sure how to insert here, looks like "<" with a line below the "<"), while the others returned "ó", letter "o" with acute accent.
So it might be that LabVIEW is "doing the right thing", but your PC is using another character mapping for accented characters ...
Bob Schor
02-22-2024 07:42 AM
your text file is not 8-bit ASCII code but UTF-8 (8-bit Unicode). LabVIEW text is 8-bit ASCII using whatever codepage your regional settings are configured for.
There are different ways to deal with it:
- Search for Unicode LabVIEW libraries and convert the byte string read from your file to ASCII.
-Make sure the writing application is writing ASCII text instead of UTF-8.
- Enable the Unicode token in your LabVIEW.ini file but be aware that that is still experimental Alpha functionality with several bugs.