Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a txt file containing label values to be displayed in Windows.Forms.Label objects. One of these strings contains a degree symbol (°). That symbol is not displayed correctly in the label text. In examining the .txt file, I can see that the ASCII value of the byte in question is 0xB0.

What I have tried:

I have tried various different fonts for the label, and various character encodings when reading in the txt file.
Posted
Updated 5-Apr-23 7:51am
Comments
[no name] 4-Apr-23 23:58pm    
The Unicode is 0x00B0; so, it seems you should be using UTF-8 (and not ascii as you're implying).

1 solution

This will help you understand how to do that: Chr function (Visual Basic for Applications) | Microsoft Learn[^]

Use the Chr function and the ascii value for degree symbol:
VB
DegreeChar = Chr(176)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900