Stm32CubeIDE compilation, Chinese character encoding GBK display

First, the principle of Chinese character display.

1. When it comes to LCD, it is to light up the pixels, display Chinese characters, and one to determine the display size, such as 16*16, 24*24. 16*16 means the length is 16 and the width is 16, with a total of 256 pixels. A Chinese character is displayed by turning it on or off.

2. Extraction of Chinese character fonts. Which pixels are lit and which are not lit are controlled by the font library, and the font library can be extracted with the help of font extraction software.

Second, Stm32CubeIDE does not display Chinese characters when compiling.

The font file has been imported into the program, but it is compiled and downloaded using Stm32CubeIDE, and Chinese characters are not displayed. Through single-step debugging, it is found that the encoding of Chinese characters does not correspond to the encoding in the font library. It is suspected that the default encoding of Chinese characters in Stm32CubeIDE is not GBK code.

Solution:

(18 messages) When Stm32CubeIDE uses the GCC compiler, the problem of using GBK encoding in Chinese_stm32cube gbk_Kavieen's Blog-CSDN Blog
 

-fexec-charset=GBK
-finput-charset=UTF-8




 

Guess you like

Origin blog.csdn.net/m0_38012497/article/details/130214071