Created
March 20, 2012 06:51
-
-
Save HungYuHei/2132090 to your computer and use it in GitHub Desktop.
convert file-encoding from gb2312 to utf-8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -MEncode -pi -e '$_=encode_utf8(decode(gb2312=>$_))' FILE_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it works for me, nice 👍 it use it for many files.
find . -maxdepth 1 -type f -exec perl -MEncode -pi -e '$_=encode_utf8(decode(gb2312=>$_))' {} \;