user26074: I have a 16x2 LCD and I want to show a temperature: 23 ºC.
But the º symbol is not properly shown. It shows a strange character instead of the º symbol .

user30198: Some displays have different characters above 128. It is best to make your own character.
That is what @dannyf ment with "CGRAM". The custom characters are stored in CGRAM. There is no need to read the datasheet though, because there is a function in the Arduino LiquidCrystal library for it.
Start here: Arduino CreateChar reference
There are even websites that help you to create the character: omerk and maxpromer.

user-1: It depends on the exact model of LCD you are using. Or more exactly, on the Dot Matrix Liquid Crystal Display Controller/Driver, like the Hitachi HD44780U that is used in many 16x2 LCD.
For that driver, you have a table of native chars, like this:

In this table, the char "°" is at col 0b1101, row 1111, (0xDF, or 223). But, you have to cast that value to a char before displaying, otherwise you will get the value (223), not the symbol.
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.backlight();
  lcd.print("temp 27");
  lcd.print((char) 223);
  lcd.print(" ");
  lcd.print(223);

}

void loop()
{
}


26074: <p>I have a 16x2 LCD and I want to show a temperature: <strong>23 ºC</strong>.</p>

<p>But the <strong>º</strong> symbol is not properly shown. It shows a strange character instead of the <strong>º</strong> symbol .</p>
 30198: <p>Some displays have different characters above 128. It is best to make your own character.</p>

<p>That is what @dannyf ment with "CGRAM". The custom characters are stored in CGRAM. There is no need to read the datasheet though, because there is a function in the Arduino LiquidCrystal library for it.</p>

<p>Start here: <a href="https://www.arduino.cc/en/Reference/LiquidCrystalCreateChar" rel="noreferrer">Arduino CreateChar reference</a><br>
There are even websites that help you to create the character: <a href="https://omerk.github.io/lcdchargen/" rel="noreferrer">omerk</a> and <a href="http://maxpromer.github.io/LCD-Character-Creator/" rel="noreferrer">maxpromer</a>.</p>
 -1: <p>It depends on the exact model of LCD you are using. Or more exactly, on the Dot Matrix Liquid Crystal Display Controller/Driver, like the Hitachi HD44780U that is used in many 16x2 LCD.</p>

<p>For that driver, you have a table of native chars, like this:</p>

<p><a href="https://i.stack.imgur.com/1TKZH.gif" rel="noreferrer" title="LCD Character Set - source: mil.ufl.edu"><img src="https://i.stack.imgur.com/1TKZH.gif" alt="LCD Character Set - source: mil.ufl.edu" title="LCD Character Set - source: mil.ufl.edu"></a></p>

<p>In this table, the char "°" is at col 0b1101, row 1111, (0xDF, or 223). But, you have to cast that value to a char before displaying, otherwise you will get the value (223), not the symbol.</p>

<pre><code>#include &lt;Wire.h&gt; 
#include &lt;LiquidCrystal_I2C.h&gt;

LiquidCrystal_I2C lcd(0x3F,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.backlight();
  lcd.print("temp 27");
  lcd.print((char) 223);
  lcd.print(" ");
  lcd.print(223);

}

void loop()
{
}
</code></pre>
