Best way to convert text files between character sets?

后端 未结 21 2283
再見小時候
再見小時候 2020-11-22 04:42

What is the fastest, easiest tool or method to convert text files between character sets?

Specifically, I need to convert from UTF-8 to ISO-8859-15 and vice versa.

21条回答
  •  既然无缘
    2020-11-22 05:12

    Try iconv Bash function

    I've put this into .bashrc:

    utf8()
    {
        iconv -f ISO-8859-1 -t UTF-8 $1 > $1.tmp
        rm $1
        mv $1.tmp $1
    }
    

    ..to be able to convert files like so:

    utf8 MyClass.java
    

提交回复
热议问题