Skip to main content
May 17, 2020
Question

Cyrillic symbos, UTF-8 and TouchGFX

  • May 17, 2020
  • 7 replies
  • 3764 views

Hello, I from Russia and I use cyrillic symbols.

In touchGFX Designer I use cyrillyc symbols without problems.

But if I type cyrillic symbols in IDE, in codefiles

Mytext="Cyrillic_Text";

I get "?????????" on touchGFX gadget.

I try to translate codefiles to UTF-8 - same result: "?????????"

How to solve this problem?

This topic has been closed for replies.

7 replies

Karan 123
Senior
May 17, 2020

Hi,

Did you set Text ->Typography-> WildCard ranges as below for textArea1Buffer ?

0693W000001cO5AQAU.png

Hope this helps..

--

Karan

May 17, 2020

No.

This is my options. Without any effect

0693W000001cO8sQAE.png

Karan 123
Senior
May 17, 2020

Do you able to see A-Z in Text Area? ​

May 17, 2020

Yes. I see all symbols, excluding cyrilllyc.

Cyryllic symbols are replaced by "?".

Impotrtant: one cyrillyic symbol replaced by two "?".​

Romain DIELEMAN
ST Employee
May 18, 2020

Have you selected a font supporting Cyrillic? You should found some online (ttf files) and add them in TouchGFX/assets/fonts if you have not found one. (Watchout, if this is for a commercial project make sure you have the license for the font)

EDIT: Verdana actually supports Cyrillic, I did not know. But if you intend to add other languages or if you want to use another font for your text, this is the way to do it if not found in Designer.

May 18, 2020

If I use cyrillic symbols on textarea in touchgfxdesigner, I have no problem.

If I set value of text string in IDE (keil), I have problem.​

Martin KJELDSEN
Principal III
May 18, 2020

Check your generated files to see if those unicodes have even been geenrated. For instance, here's generated/fonts/src/Font_Verdana_10_4bpp_0.cpp with the pixel data for a single glyph 0x003F. If touchgfx cannot find your glyphs in the generated files then it will display "?" (if you chose a fallback character).

#include <touchgfx/hal/Types.hpp>
 
FONT_GLYPH_LOCATION_FLASH_PRAGMA
KEEP extern const uint8_t unicodes_verdana_10_4bpp_0[] FONT_GLYPH_LOCATION_FLASH_ATTRIBUTE =
{
 // Unicode: [0x003F, ]
 0xD2, 0xCE, 0x03, 0x21, 0x50, 0x0C, 0x00, 0x30, 0x0C, 0x00, 0xC1, 0x05, 0x00, 0x4D, 0x00, 0x00,
 0x0C, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0F, 0x00
};

DKlyu.1
Visitor II
May 28, 2020

I work with Cyrillic as follows

touchgfx::Unicode::UnicodeChar buffer[100]; 
 Unicode::fromUTF8((const uint8_t*)"тек�?т", buffer, 100);
 btn.setWildcard(buffer);

RG.3
Associate III
December 7, 2020

HI

What file we have to include for this.For me it is showing expected an expression

SGasp.1
Associate III
April 20, 2023

Hi @EEuge​ .. did you solve the problem ? i am facing the same issue as you.. in touch gfx words in Cyrillic are working.. but when I try to do this

 const char* parArea4[5][6] = {
 		 { "Preheating",
 								"Ready",
									" ",
									"Baking",
									"Extra time",
									"Extra time?"
 },
 						 { 	"Preriscaldo",
 							 "Pronto",
								 " ",
									 "Cottura",
									 "Extra time",
									"Extra time?"
 							 },
								 { 	"Prechauffage",
								 "Pret",
						 " ",
									 "Cuisson",
									 "Extra time",
									"Extra time?"
								 },
								 { 	"Предварительный нагрев",
									"Pronto",
								 " ",
									 "Выпечка",
									 "Extra time",
									 "Extra time?"
								 },
								 { 	"Preriscaldo",
									"Pronto",
						 " ",
									"Cottura",
								 "Extra time",
									"Extra time?"
								 }
 };
 
uint8_t tipolingua = 3; //cyrillic 
textArea4.setColor(touchgfx::Color::getColorFrom24BitRGB(236, 209, 18));//extra time?
				Unicode::strncpy(textArea4Buffer, parArea4[tipolingua][5], Unicode::strlen(parArea4[tipolingua][5])+1);
				textArea4.invalidate();

on the display i see a lot of question marks??

How can i fix it ?

Thanks

SGasp.1
Associate III
April 26, 2023

Hi @EEuge​ .. were you able to solve the issue ? How did you do?