How to print degree Celsius sign? The simplest way

Does anyone know how to print degree of Celsius quickly?

lv_label_set_text_fmt(lblInside, "Inside: #%s %s°c#", strColour, json_object_get_string(btemp));

Quick enough?

Which version? It does not produce ° sign on 7.11.

7.5 and 8.1

Gabor was kind enough to include the degree symbol for me in the fonts:

Try copying the symbol directly from the font file in case HTML is messing the encoding up:

not all degree symbols are the same, IIRC there are 3 of them…

another copy of this:

It does not work for me either way:

lv_label_set_text_fmt(lbl_temp_mv_canvas, "%s %c C", pBoilerTemp->s, 0xB0); lv_label_set_text_fmt(lbl_temp_return_canvas, "%s °C", pReturnTemp->s); /* from line 1596 monts_26 */

Do not know why, I can see it in the font I use.

sorry, I did mean copy the degree symbol itself not the code:

If that doesnt work maybe @kisvegabor might be able to help?

Tried both. No go.

Maybe your source code isn’t encoded as UTF-8.
I don’t know what editor (IDE) you use.
But if you take notepad++ and open the source file, you can see the actual coding of your source file.
If it is ANSI the ° will not be seen on your display.
With notepad++ you can also easily convert the encoding from ANSI to UTF-8

1 Like

Also you need to enable unicode-support.

I type on the keyboard ALT 0176
This meens, hold the ALT key down and type 0176 on the num keyboard

Strangely, it works in MCU, so the issue has been resolved.

  • Don’t use With notepad++, How to use c code to convert the encoding from ANSI to UTF-8,thanks


I’m using VSCode as my editor and a Mac as my host. For me, I was able to insert a degree symbol into a string simply by using Option-Shift-8.