Update
This blog is obselete, please head forward to this blog.
I’m tired of transform shift-jis encoding to UTF-8 encoding for each file in my project these days, so I want to write a script to automatically do this job for me. After searching the Internet, I find it’s an easy job with the tool of Python.
Python, at least 2.6 version, has a library called codecs, and all we have to do is just using this library to read and write files in different encodings.
This code transforms all files, including files in sub-folders, from shift-jis encoding(or detected encodings) to UTF-8 encoding.