GWT:字符编码变音 [英] GWT: Character encoding umlauts

查看:19
本文介绍了GWT:字符编码变音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在标签中设置文本:

I want to set a text in a label:

labelDemnaechst.setText(" Demnächst fällig:");

在应用程序的输出中,字符ä"显示错误.

On the output in the application the characters "ä" are displayed wrong.

我怎样才能很好地展示它们?

How can I display them well?

推荐答案

好吧,您必须将特殊字符编码为 Unicode.您可以在此处找到代表性的 Unicode 字符列表.

well you have to encode your special charactars to Unicode. You can finde a list of the representive Unicode characters here.

您的示例如下所示:

    labelDemnaechst.setText("Demnu00E4lachst fu00E4llig:");

如果没有更好的解决方案,希望这会有所帮助.

Hope this helps, if noone has a better solution.

附录:

感谢 Thomas 的提示,您确实必须更改 Eclipse 保存源文件的格式.默认情况下,它使用 Cp1252 之类的东西.如果您将其更改为 UTF-8,则您的示例工作正常.(所以 Demnächst 写得正确).

Thanks Thomas for your tipp, you really have to change the format in which eclipse safes it's source files. Per default it uses something like Cp1252. If you change it to UTF-8, your example works correct. (So Demnächst is written correctly).

您可以编辑安全格式,如果您右键单击您的文件 --> 首选项.

You can edit the safing format, if you right-click on your file --> Preferences.

这篇关于GWT:字符编码变音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆