所以,
我一直在尝试使用我在网上找到的提示和矩阵,将大型java源代码树从cp1252转换为Windows中的UTF-8,特别是here https://stackoverflow.com/a/9310774。问题是,我在 Windows 上;我不做VB; Cygwin 的 iconv 不接受-o
switch.
我首先尝试使用的行是:
find . -type f -print -exec iconv -f cp1252 -t utf-8 {} > {}.converted \; -exec mv {}.converted {} \;
这会创建一个文件{}.converted
在工作目录和第二个-exec
由于明显的原因而失败。
在 iconv 表达式周围加上引号:
find . -type f -print -exec 'iconv -f cp1252 -t utf-8 {} > {}.converted' \; -exec mv {}.converted {} \;
结果出现以下错误:
find: `iconv -f cp1252 -t utf-8 ./java/dv/framework/activity/model/ActivitiesMediaViewImpl.java > ./java/dv/framework/activity/model/ActivitiesMediaViewImpl.java.converted': No such file or directory
尽管手动执行各个表达式效果非常好。
我尝试过随机引用,但似乎没有任何效果,我错过了什么?为什么不起作用..?
提前感谢,
拉尔斯
for f in `find . -type f`; do
iconv -f cp1252 -t utf-8 $f > $f.converted
mv $f.converted $f
done
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)