Search This Blog

Mac OS X: convert gb2312/gbk/gb18030 chinese text to utf-8

  • 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 cp936 -t utf-8 chinese-gb2312.txt > chinese-utf8.txt
    
  • To list the encodings that iconv supports:
    iconv -l
    

See also

No comments:

Post a Comment