How to Convert Unicode to UTF-8 for making Korean Font

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • How to Convert Unicode to UTF-8 for making Korean Font

    JEONG




    Dear SEGGER Forum Family

    Hi, I am the user of the board 'STM32439I-EVAL2'.
    I tried to write the Koean Font on the board. Thus, I have used the funtion to convert Unicode to UTF8 "GUI_UC_ConvertUC2UTF8(const U16 GUI_UNI_PTR * s, int Len, char * pBuffer, int BufferSize);" which can convert Unicode to UTF-8 code and "GUI_UC_SetEncodeUTF8();" which can activate UTF-8 code. But, It does not work at all. The most huge problem I got is that Unicode is not changed to UTF-8 code. I really want to know how to fix this problem the way to transduce Unicode to UFT-8. Here Is code I made as a sample.

    <GUIDEMO_Intro>



    extern GUI_CONST_STORAGE GUI_FONT GUI_FontHY_HumanLetter_ M 1 8 ;
    U16 strTest[30];
    U16 strUTFTest[32];
    void GUIDEMO_Intro(void) {
    char acVersion[30] = "Version of STemWin: ";
    int xCenter, xSize, ySize;
    xSize = LCD_GetXSize();
    ySize = LCD_GetYSize();
    xCenter = xSize >> 1;
    GUIDEMO_DrawBk(0);
    GUI_SetTextMode(GUI_TM_TRANS);
    memset( strTest,0,sizeof(strTest) );
    strTest[0]=0xAC00; //"geyeok
    GUI_SetFont(&GUI_FontHY_HumanLetter_M 1 8 );
    memset( strUTFTest,0,sizeof(strUTFTest));

    <GUI_CONST_STORAGE GUI_FONT GUI_FontHY_HumanLetter_M18>
    #include "GUI.h"
    #ifndef GUI_CONST_STORAGE
    #define GUI_CONST_STORAGE const
    #endif
    /* The following line needs to be included in any file selecting the
    font.
    */
    extern GUI_CONST_STORAGE GUI_FONT GUI_FontHY_HumanLetter_ M 1 8 ;
    /* Start of unicode area <Hangul Syllables> */
    GUI_CONST_STORAGE unsigned char acGUI_FontHY_HumanLetter_M18_AC00[ 28] = { /* code AC00, <Hangul Syllable, First> */
    ________,________,
    __XXX___,___X____,
    _____XX_,___X____,
    ______X_,___X____,
    ______X_,__X_____,
    ______X_,__XXXXX_,
    ______X_,__X_____,
    _____X__,__X_____,
    _____X__,__X_____,
    _____X__,__X_____,
    ________,__X_____,
    ________,__X_____,
    ________,__X_____,
    ________,________};

    I would really happy If anyone could help me to solve this problem.

    Sinderely,

    JEONG

    The post was edited 5 times, last by Jeong ().

  • Hi,

    The Unicode-implementation of emWin is based on UTF8. Because of that it is highly recommended to use UTF8-encoded text in emWin. The Unicode chapter (sub chapter of 'Language support') describes exactly what needs to be done to get for example Japanese text on the display.

    Regards, Jörg
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.