File encoding in OSX


Encoding Type For File
Using the -I (that's a capital i) option on the file command seems to show the file encoding.
file -I {filename}

Encoding Conversions For File
Convert from one file type to another using the following command:

iconv -f original_charset -t new_charset originalfile > newfile
e.g.
iconv -f utf-16le -t utf-8 file1.txt > file2.txt

Comments

Popular posts from this blog

Xcode Server build number incrementation

Useful git commands