02-02-2023 02:40 PM
I am reading in data from a .xlsx file, apparently encoded in ANSI(?). Labview can take the data just fine and when creating a text file based on the data, when opened/viewed with encoding ANSI (notepad++ or just notepad) it looks fine. The problem being that Notepad++ is defaulted to UTF-8 so not many people know to change the encoding to "ANSI" and the ° symbol does not translate well.
My question is how would we translate the symbol ° to also ° but in UTF-8 in LabVIEW.
02-02-2023 03:08 PM
Hi Anth,
@AnthN wrote:
I am reading in data from a .xlsx file, apparently encoded in ANSI(?).
How do you read your data?
Why do you think it's ANSI, whatever this may mean?
02-02-2023 03:33 PM - edited 02-02-2023 03:56 PM
I use the Report Generation Toolkit Excel Get Data VI to get the data from excel and return it as a 2D string array in LabVIEW.
I am making the assumption that it's encoded in ANSI because when I open the text file (the .xml that I insert the excel data into) in Notepad++
I get 2 characters for what was supposed to be my degree symbol °, and when I change the encoding from UTF-8 to ANSI then the data is as how I inserted it. Also when I open the .xml file in Notepad, the degree symbol shows normally
02-03-2023 01:44 AM
Hi Anth,
@AnthN wrote:
I am making the assumption that it's encoded in ANSI because when I open the text file (the .xml that I insert the excel data into) in Notepad++ I get 2 characters for what was supposed to be my degree symbol °, and when I change the encoding from UTF-8 to ANSI then the data is as how I inserted it.
When you get 2 chars then its encoded in UTF8 (hex C2 B0).
When encoded in ANSI you should get just one char (hex B0).
@AnthN wrote:
My question is how would we translate the symbol ° to also ° but in UTF-8 in LabVIEW.
You already found how to convert a LabVIEW string into UTF8. When you want to display that Unicode string in LabVIEW you need to switch the string indicator to Unicode…