GWT i18n Message Properties does not Display special Character like ß

后端 未结 2 2066
孤独总比滥情好
孤独总比滥情好 2021-01-24 08:39

I use GWT i18n Messages to translate messages:

@DefaultLocale(\"en\")
public interface Messages extends com.google.gwt.i18n.client.Messages {

    @DefaultMessag         


        
相关标签:
2条回答
  • 2021-01-24 08:49

    GWT is always UTF8. So the easiest way to solve your problem is, to set the encoding of your workspace to utf-8.

    Or select your Messages_de.properties, right mouse button and select properties. Use Resources to set the encoding of your property file to utf-8.

    enter image description here

    0 讨论(0)
  • 2021-01-24 08:52

    This is a problem with the way Eclipse handles properties files. You can set the whole workspace to UTF-8, it will still treat properties files as ISO 8859-1 - because that's the default/expected encoding. However, GWT uses an enhanced properties file format that uses UTF-8 directly (without the need for escaping the characters).

    You have to override this setting separately:

    Setting encoding for properties files in Eclipse

    You can change the default encoding for all *.properties files to UTF-8 there (don't forget to hit the Update button).

    But please note that this will mean treating all properties files as UTF-8. So unless you are sure this will not break anything, I'd narrow down the file association for example to *Messages.properties files (if all your translation files have the Messages suffix). Or just use a different editor for editing the properties files.

    0 讨论(0)
提交回复
热议问题