Tuesday, June 30, 2009

How to check a file's encoding under Linux

Use the following command:

file $file_name

For example:

$ file cn.txt
cn.txt: UTF-8 Unicode text, with CRLF line terminators

No comments: