From 365002441098105ab274b51328548f1d735f5b68 Mon Sep 17 00:00:00 2001 From: Jerry Date: Wed, 12 Aug 2020 22:14:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0UTF8=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=87=BD=E6=95=B0,=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E5=AF=B9floor=E5=87=BD=E6=95=B0=E7=9A=84=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GUI/inc/SGUI_Text.h | 2 ++ GUI/src/SGUI_Basic.c | 2 +- GUI/src/SGUI_Text.c | 50 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/GUI/inc/SGUI_Text.h b/GUI/inc/SGUI_Text.h index af317df..8789108 100644 --- a/GUI/inc/SGUI_Text.h +++ b/GUI/inc/SGUI_Text.h @@ -17,6 +17,7 @@ #define SGUI_TEXT_DECODER_ASCII SGUI_Text_StepNext_ASCII #define SGUI_TEXT_DECODER_GB2312 SGUI_Text_StepNext_GB2312 +#define SGUI_TEXT_DECODER_UTF8 SGUI_Text_StepNext_UTF8 #define SGUI_TEXT_INDEXMAPPER_DIRECT SGUI_Text_IndexMapper_Direct @@ -38,6 +39,7 @@ SGUI_SIZE SGUI_Text_DrawMultipleLinesText(SGUI_SCR_DEV* pstDeviceIF, SGUI_CSZST SGUI_SIZE SGUI_Text_GetMultiLineTextLines(SGUI_CSZSTR cszText, const SGUI_FONT_RES* pstFontRes, SGUI_SIZE uiDisplayAreaWidth); SGUI_CSZSTR SGUI_Text_StepNext_ASCII(SGUI_CSZSTR cszSrc, SGUI_UINT32* puiCode); SGUI_CSZSTR SGUI_Text_StepNext_GB2312(SGUI_CSZSTR cszSrc, SGUI_UINT32* puiCode); +SGUI_CSZSTR SGUI_Text_StepNext_UTF8(SGUI_CSZSTR cszSrc, SGUI_UINT32* puiCode); SGUI_UINT32 SGUI_Text_IndexMapper_Direct(SGUI_UINT32 uiCode); #endif diff --git a/GUI/src/SGUI_Basic.c b/GUI/src/SGUI_Basic.c index dba3e45..5e0da4c 100644 --- a/GUI/src/SGUI_Basic.c +++ b/GUI/src/SGUI_Basic.c @@ -799,5 +799,5 @@ SGUI_COLOR SGUI_Basic_MapColor(const SGUI_UINT8 uiOriginDepthBits,const SGUI_COL { SGUI_UINT16 uiOriginSpace=(1<> uiCharacterLength; + while((--uiCharacterLength)>0){ + uiCode = (uiCode)<<6 | ((*pcNextChar++) & 0x3F); + } + } + } + *puiCode = uiCode; + return pcNextChar; +}