Jump to content

Accented characters not showing properly on Console widget

Recommended Posts

Maybe there's a note about this somewhere, but when gwinPrintf-ing accented characters from my custom font to a console, they don't render correctly. gwinSetText works fine for labels.

So for example,

gwinSetText(ghLabel, "é", gFalse); // works
gwinPrintf(ghConsole, "é"); // doesn't work, prints "é"

Is there a way to make this work using the console widget?


Link to post
Share on other sites

Hmm. Without looking at the code, it looks like a utf8 encoding problem. The reason I have this suspicion is that for the label you are getting a single character output, for the console you are getting a two character output. I suspect that while the two strings look the same they are actually encoded differently.

Both the console and the label use the same underlying font routines so the only way they would give different output for the same input is if perhaps the console is printing byte by byte instead of character by character or string print.

Try putting the string into a variable and then using that variable to print both the label and the console. If you get the same result let me know and I will go digging.

Link to post
Share on other sites

Hi @inmarket, I get the same result as before with this code:

    characcented = "é";
    gwinSetText(ghTitleLblaccentedgTrue); // works, sets text to "é"
    gwinPrintf(ghConsoleaccented);               // doesn't work, prints "é"
Link to post
Share on other sites
  • 3 weeks later...

Sorry, I have been away and unable to respond. I will be back this coming weekend and will have a good look as soon as I can. The most likely reason is gwinPrintf is processing byte by byte rather than character by character. 

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...