Skip to content

Instantly share code, notes, and snippets.

@HungYuHei
Created March 20, 2012 06:51
Show Gist options
  • Save HungYuHei/2132090 to your computer and use it in GitHub Desktop.
Save HungYuHei/2132090 to your computer and use it in GitHub Desktop.
convert file-encoding from gb2312 to utf-8
perl -MEncode -pi -e '$_=encode_utf8(decode(gb2312=>$_))' FILE_NAME
@flomnes
Copy link

flomnes commented Mar 3, 2018

Allowed me to convert Chinese subtitles from GB2312 to UTF-8, which work properly in VLC. Many thanks !

@logerrors
Copy link

logerrors commented Apr 3, 2021

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=>$_))' {} \;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment