UTF-8 Conversion

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

  • UTF-8 Conversion

    Hi
    We are trying to convert UTF-8 text to escaped text that can be used with emWin. We do not want to use U2C.exe because we want to automatically generate the text from our localised text repository. We have generated text as per the manual but this is not working as expected.
    For example we would expect the "Français" to convert to "Fran\xc3\xa7ais" however this does not display correctly in out application it comes up as "Franúis". When we run the same text through U2C.exe it is translated as "Fran\xc3\xa7""ais" and this is display correctly in out application. My question is are there additional rules for translating form UTF-8 to escaped text.
    Regards,
    Brian J.
  • Hello Brian,

    This is not an actual Unicode rule, but you should consider the fact that following characters might be taken as a hex digit. You actually insert the hex values 0xC3 and 0xA7A to your text. The U2C tool inserts the double quotes "" to let the compiler know that the following byte should be taken as a character again.

    Best regards,
    Adrian