属性文件中的特殊字符 [英] Special characters in properties file
问题描述
在我的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.
但是还不清楚:在运行本文中编写的命令之后,在我的控制台(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屋!