我是一名Java开发人员,我正在使用Ubuntu进行开发.该项目是在Windows中使用Eclipse创建的,它使用的是CP1252编码.
要转换为UTF-8,我使用了重新编码程序:
find Web -iname \*.java | xargs recode CP1252...UTF-8
Run Code Online (Sandbox Code Playgroud)
此命令会出现此错误:
recode: Web/src/br/cits/projeto/geral/presentation/GravacaoMessageHelper.java failed: Ambiguous output in step `CR-LF..data
Run Code Online (Sandbox Code Playgroud)
我已经关注它并在此处获得解决方案:http://fvue.nl/wiki/Bash_and_Windows#Recode:_Ambiguous_output_in_step_.60data..CR-LF.27 它说:
将行结尾从CR/LF转换为单个LF:使用vim编辑文件,给出命令:set ff = unix并保存文件.Recode现在应该运行没有错误.
很好,但我有很多文件要删除CR/LF字符,我无法打开每个人来做它.Vi不为bash操作提供命令行的任何选项.
sed可以用来做这个吗?怎么样 ?
谢谢=)
我有以下程序:
#!/usr/local/bin/python3
print("Hello")
Run Code Online (Sandbox Code Playgroud)
通过终端我做test.py,我得到:
Traceback (most recent call last):
File "/usr/lib/python3.3/site.py", line 629, in <module>
main()
File "/usr/lib/python3.3/site.py", line 614, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python3.3/site.py", line 284, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python3.3/site.py", line 260, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python3.3/site.py", line 250, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python3.3/sysconfig.py", line 610, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python3.3/sysconfig.py", line 560, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python3.3/sysconfig.py", line 432, in …Run Code Online (Sandbox Code Playgroud)