Best way to convert text files between character sets?

后端 未结 21 2031
再見小時候
再見小時候 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:19

    Assuming, you don't know the input encoding and still wish to automate most of the conversion, I concluded this one liner from summing up previous answers.

    iconv -f $(chardetect input.text | awk '{print $2}') -t utf-8 -o output.text
    

提交回复
热议问题