Appwizard export will change the encoding of my code

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

    • Appwizard export will change the encoding of my code

      Hi

      The code before export is as follows.

      Source Code

      1. void ID_SCREEN_LEARN__ID_SWITCH_MODE1__WM_NOTIFICATION_VALUE_CHANGED_0(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {
      2. GUI_USE_PARA(pAction);
      3. GUI_USE_PARA(hScreen);
      4. GUI_USE_PARA(pMsg);
      5. GUI_USE_PARA(pResult);
      6. int siwtchState = SWITCH_GetState(WM_GetDialogItem(WM_HBKWIN, ID_SWITCH_MODE1));
      7. printf("switch 1 toggle val:%d\n", siwtchState);
      8. if (siwtchState)
      9. { //learn mode
      10. TEXT_SetText(WM_GetDialogItem(WM_HBKWIN, ID_TEXT_WORKMODE1), "学习模式");
      11. } else { //work mode
      12. TEXT_SetText(WM_GetDialogItem(WM_HBKWIN, ID_TEXT_WORKMODE1), "工作模式");
      13. }
      14. }
      Display All
      The code after export is as follows

      Source Code

      1. void ID_SCREEN_LEARN__ID_SWITCH_MODE1__WM_NOTIFICATION_VALUE_CHANGED_0(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {
      2. GUI_USE_PARA(pAction);
      3. GUI_USE_PARA(hScreen);
      4. GUI_USE_PARA(pMsg);
      5. GUI_USE_PARA(pResult);
      6. int siwtchState = SWITCH_GetState(WM_GetDialogItem(WM_HBKWIN, ID_SWITCH_MODE1));
      7. printf("switch 1 toggle val:%d\n", siwtchState);
      8. if (siwtchState)
      9. { //learn mode
      10. TEXT_SetText(WM_GetDialogItem(WM_HBKWIN, ID_TEXT_WORKMODE1), "?-|?1??��????");
      11. } else { //work mode
      12. TEXT_SetText(WM_GetDialogItem(WM_HBKWIN, ID_TEXT_WORKMODE1), "?????????????�꨺?");
      13. }
      14. }
      Display All
      My file encoding is utf8.How to solve this problem.
      Thanks!
    • Hi,

      You need to convert the strings to UTF-8. To do this, I recommend using our tool U2C.

      Alternatively, you can use this website to convert the strings: browserling.com/tools/utf8-encode (third-party website not affiliated with SEGGER).

      You can find more detailed information about UTF-8 encoding in our manual: segger.com/doc/UM03001_emWin.html#UTF_8_encoding

      Best regards,
      Florian
      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.