ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/4
2,601件の閲覧回数

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 件の賞賛
メッセージ2/4
2,585件の閲覧回数

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 件の賞賛
メッセージ3/4
2,574件の閲覧回数

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
メッセージ4/4
2,524件の閲覧回数