Using Umlaute in strings

As I am german speaking I would like to add some german text e.g. "fünf" to my clock face.

Unfortunately this those not seem to work.
As soon as I want to write a text using a statement like this:

dc.drawText(x, y, Gfx.FONT_LARGE, "fünf" , Gfx.TEXT_JUSTIFY_CENTER);

the program just crashes.

If I set the language on my 920XT to German then the menus contain Umlaute.
So it's most likely a programming issue.

Could anyone give me a hint on this?
  • Former Member
    Former Member over 10 years ago
    Have you tried using a string resource instead of hard coding the string in code? Try using something like this:
    <string id="funf">fünf</string>

    Then in your Monkey C file use:
    var label = Ui.loadResource(Rez.Strings.funf);
    dc.drawText(x, y, Gfx.FONT_LARGE, label , Gfx.TEXT_JUSTIFY_CENTER);

    For more details on using string resources I would point you towards the Strings sample included with the SDK.
  • Another concern is the editor that you use. I found that the Windows programs notepad.exe or write.exe caused problems when creating resource strings with non-ascii characters. It seemed to work fine if I used Eclipse.

    Travis
  • Using string resources does the trick.

    I am currently using Eclipse to edit my code as well as the resource files. I dont think that this is related to the encoding in the source file.

    Thanks for your answers.

    Dani
  • Former Member
    Former Member over 10 years ago
    I'm glad that worked for you. I'll file a bug report but it will probably be a lower priority since the string resources are working. Thanks for the report.