UTF-8 code to Nextion display

Hello, I have a very strange issue when trying to show UTF-8 characters on a Nextion display.

Below code from Ben in this topic Convert String to hex works with his example text L'ÉTÉ. It shows L'ÉTÉ on the Nextion.

  Serial1.print("eltxt.txt=" + String("\""));
  byte message[5] = {0x4c, 0x27, 0xc9, 0x54, 0xc9}; // "L'ÉTÉ" string
  Serial1.write(message, 5);
  Serial1.print(String("\""));
  Serial1.write(0xff);
  Serial1.write(0xff);
  Serial1.write(0xff);

But it does not work when I do the same with the code below. Probably becasue the é character uses 2 bytes?

  Serial1.print("eltxt.txt=" + String("\""));
  byte message[2] = {0xC3, 0xA9}; // "é" character
  Serial1.write(message, 5);
  Serial1.print(String("\""));
  Serial1.write(0xff);
  Serial1.write(0xff);
  Serial1.write(0xff);

When I run eltxt="é" in the Nextion debugger it results in Ä with a copyright sign

But when I enter a text which also includes the é as default text for this textbox then it shows ok.

Does anyone know how I can send 2, 3 or 4 byte UTF-8 characters to the Nextion?

What font are you using? Was is generated with UTF-8 encoding instead of the default iso-8859-1.

From the Nextion Editor Guide

Selecting the DISPLAY tab, the user can select the orientation and the Character Encoding. 0° is the native viewing angle for the selected model. Users can choose alternative orientations (90°, 180° or 270°) but this will not be the native viewing angle.

Character Encoding is default iso-8859-1. Select from the character encodings that make sense for your HMI project to best display your local character sets. There are a selection of single byte and double byte character sets available.

Currently supported Character encodings include:
ASCII, ISO-8859-X (1,2,3,4,5,6,7,8,9,11,13,15), UTF8,
GB2312, BIG5, KS_C_5601-1987, Shift-JIS, koi8-r,
Windows 874, 1255, 1256, 1257, and 1258

Thanks for that tip cattledog!

I just see that the fonts were created ISO-8859. Now I created 2 UTF-8 fonts but they seem to occupy a lot of memory as now the file size (File Size:21,642,728) is too big and I can not upload it to my Nextion anymore. I already deleted all of my unused fonts but it still is too big.
So I can not test it at this moment.

I deselected a lot of languages in the font generator to drastically limit the size of the generated font. Especially all the chinese characters consume a lot of memory.
All works like a charm now.

Thanks cattledog as I overlooked this simple solution :slight_smile:

.

I think it would be fair to mark @cattledog s answer as solution or at least give him a like/heart for his advise.

Sorry, I am not fully aware of how this forum works :blush:
So forgive me @cattledog :pray: And thanks again for the tip!