LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ansi symbol to UTF-8

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. 

AnthN_0-1675370281386.png


My question is how would we translate the symbol ° to also ° but in UTF-8 in LabVIEW.

0 Kudos
Message 1 of 4
(1,476 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(1,460 Views)

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

0 Kudos
Message 3 of 4
(1,449 Views)

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

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(1,399 Views)