档案内的耳朵编码
这几天我抓狂了,想用Weblogic在unix环境下部署一个ear。
最后我通过使用 (cat -v file.properties) 意识到该文件在行尾充满了 ^M。
发生这种情况是因为我在 Windows 上编辑了属性文件,然后通过 FileZilla 转移到生产环境。
通过使用 dos2unix 命令,我解决了问题,并且文件的编码现在是正确的。
因为属性文件不是我编辑的唯一文件,但我打开了ear存档并自定义了配置.xml也是,然后再次关闭ear并将其传输到linux,您认为即使该xml嵌入ear内部,该xml的编码也会有问题吗?
谢谢
These days, I drove crazy to deploy an ear on unix enviroment using Weblogic.
At the end I realized by using (cat -v file.properties) that such file was full of ^M at the end of the line.
This happened because I edited the properties file on Windows and I transfered to the production eviromnment by FileZilla.
By the usage of dos2unix command, I addressed the problem and the encoding of the file right now is correct.
Because the properties file it's not the only one I edit, but I open the ear archive and customize the config.xml too, and then close the ear again and transfer it to linux, do you think that the encoding of that xml can be a problem even if it's embedded inside the ear ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 ant fixcrlf 自动删除回车符。
如果您使用 Maven,您还可以运行 ant 任务来准备文件。
You could remove the carriage return characters automatically with ants fixcrlf.
If you use maven you could also run an ant task to prepare the files.