Little-endian UTF-16 Unicode text, with very long lines, with CRLF line terminators

来源:互联网 发布:python社区 知乎 编辑:程序博客网 时间:2024/06/05 12:42

Sometimes you can have the problem that you cannot 'grep' files in Linux, if those files are generated on a Windows station.
If you check the file type, by typing "file [filename]", you can see the following output:

  Little-endian UTF-16 Unicode text, with CRLF line terminators

Then you can use the following command to convert the file to utf-8: 
  iconv -f utf-16 -t utf-8 [filename] > [new_filename]

after that you can stilll convert it to Unix if you want. (dos2unix or fromdos)


原文地址: http://schelstraete.org/index.php/linux/608-convert-little-endian-utf-16-unicode-text-with-crlf-line-terminators

0 0
原创粉丝点击