Special characters like scands won't display, only question marks

Hi,

Has anybody succeeded in displaying special characters like scandinavian characters: åæøÅÆØ

In the simulator for fenix3 it displays questionmarks in diamond blocks, and in the simulator for 920xt and on actual 920xt it displays nothing.

This is with the built-in Garmin fonts. I tried them all, espcially the non-NUMBER fonts.

I am pulling my hair out over this one.

Can anybody please assist.

Try this:

dc.drawText(dc.getWidth() / 2, (dc.getHeight() / 2), Gfx.FONT_MEDIUM, "åæøÅÆØ", Gfx.TEXT_JUSTIFY_CENTER);

Regards,

H
  • If the characters are hard coded in the code, it won't display correctly.

    If the characters are in a language file, it seem to display correctly.

    Problem is I cannot translate for all languages.

    Why is the automatic character mapping not working?

    If I export my own font with the above characters, it display some weird combinations of two or three characters per original character.
  • It's because of the source files encoding in Eclipse, change in Window > Preferences > General > Workspace : Text file encoding
    Set to UTF-8, now your special source characters will change also to "square question mark" characters, type in the correct ones, save and start simulator and you should see correct output.
  • It's because of the source files encoding in Eclipse, change in Window > Preferences > General > Workspace : Text file encoding
    Set to UTF-8, now your special source characters will change also to "square question mark" characters, type in the correct ones, save and start simulator and you should see correct output.


    Thanks that solved it for the build in fonts.

    I am trying to troubleshoot a custom imported font to display the special chars.

    "å æ ø"

    So in a UTF-8 saved file these chars become
    "å æ ø"

    My exported font does contain the chars "å æ ø"

    But when running in simulator, I see:

    "å æ ø"

    What is wrong with the character mappings, what do I miss?

    Note that with the above encoding etc the build-in fonts display the chars correctly as "å æ ø", therefor I can confirm that file encodings are right.
  • I can't exactly tell what you are doing, but utf-8 encoded "å æ ø" becomes "Ã¥ æ ø" if you attempt to read it as codepage 1252. You can see this if you have a utf-8 code source file with the first string and then change Eclipse text file encoding to cp-1252. At some place you could be mixing up encodings, or check with Character Map utility (Windows) to see which charsets the font file supports.
  • Seems to me there was a whole discussion about this a month or so back - using strings defined in the code vs as a resource. I don't recall the details, but you might find some clues there. I think it had to do with how code was compiled vs how resources are compiled, IIRC..
  • I can't exactly tell what you are doing, but utf-8 encoded "å æ ø" becomes "Ã¥ æ ø" if you attempt to read it as codepage 1252. You can see this if you have a utf-8 code source file with the first string and then change Eclipse text file encoding to cp-1252. At some place you could be mixing up encodings, or check with Character Map utility (Windows) to see which charsets the font file supports.


    The issue I started discussing here is more an issue while trying to troubleshoot another issue. So it is distracting the attention from the real issue.

    My real issue is that the garmin device for a Danish user, display some weird characters instead of the correct character "ø". This happens when displaying the date. There is no hard coded characters in this case, so no way that I am mixing up encodings here.
    I suspect that the imported font is missing something else, but the "ø" char is definitely in the font.
    Or Garmin is not mapping the characters correctly for a user imported font, although it works with the built-in fonts.

    The issue with the special characters in resource files and source files was merely problems I encountered in trying to reproduce the issue.

    The other frustrating issue is that the date is not language sensitive when changing the language in the simulator. It always display the day in English.

    Come on GARMIN, help out here please!
  • Developers must use UTF-8 coded files everywhere. Resources font files with section <resources> too. Initial topic was how to code .mc files and how to import font.

    Garmin cannot embed all the modern emojies, because of the memory limit.
  • Former Member
    Former Member
    So annoying.. and stupid that emojis are replaced by strange characters. It would be so simple for a developper to address this. Comon Garming, give it to the intern. Do something this it not professionnal.