属性文件中的特殊字符 [英] Special characters in properties file

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

问题描述

在我的Java/Spring Web应用程序中,我无法打印从属性文件中检索到的意大利语特殊字符(ò,à,è等).

In my Java/Spring web application i had problem printing special characters of italian language (ò,à,è etc.) that I retrieve from a properties file.

我找到了这篇文章 http://docs. oracle.com/cd/E26180_01/Platform.94/ATGProgGuide/html/s1816convertingpropertiesfilestoescap01.html .

但是还不清楚:在运行本文中编写的命令之后,在我的控制台(Windows的CMD控制台)中,我可以读取属性文件"translated".之后,我该怎么办?

But something is not clear: after I run the command written in the article, in my console (CMD console of windows) i can read my properties file "translated". After it, what should i do?

我应该从Windows控制台复制文本并将其粘贴到我的属性文件中吗?它似乎不是专业"的工作!

Should I copy the texts from the windows console and paste them into my properties file? It doens't seem a "professional" work!

推荐答案

无需复制输出,您可以将其重定向到文件:

There's no need in copying the output, you may just redirect it to the file:

native2ascii notTranslated.properties > translated.properties

此外,如果要使用Ant构建项目,则可以使用native2ascii ant任务,例如:

Also, if you're building your project with Ant, you can use native2ascii ant task, for example:

<native2ascii src="srcdir" dest="srcdir" includes="**/*._properties" ext=".properties"/>

我在这里假设,初始非ASCII属性文件在您的项目中被命名为*._properties.

I assume here, that the initial non-ASCII properties files are named *._properties in your project.

这篇关于属性文件中的特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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