Python 3.7.5
Conversion.py
import codecs
import sys
args = sys.argv
def main():
shiftjis_path = args[1]
utf8_path = args[2]
#Character code utf-Convert to 8 and save
fin = codecs.open(shiftjis_path, "r", "shift_jis")
fout_utf = codecs.open(utf8_path, "w", "utf-8")
for row in fin:
fout_utf.write(row)
fin.close()
fout_utf.close()
if __name__ == '__main__':
main()
I read the Shift_JIS file, create a new file with UTF-8, and write it.
Specify both the conversion source file Path and the output destination file Path as relative paths!
$ python Conversion.py <Path of conversion source file> <Path of output file>
It took about several minutes to convert the character code, so I created it to save time. I intended to post every day, but it's been a while since my last post. .. .. I'm going to start shaved again for 3 days from today! !! !!
Recommended Posts