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; +}