File Encoding Convert
Mac OS X comes with iconv utility that can convert text between encodings. Run the following command in Terminal to convert a gb2312 chinese text file to utf-8:
iconv -f GB2312 -t UTF-8 chinese-gb2312.txt > chinese-utf8.txt
To list the encodings that iconv supports:
iconv -l
Break Line Convert
brew install unix2dos
unix2dos file-to-convert
dos2unix file-to-convert