Answers for "decode utf-8 python\"

1

python encoding utf 8

# -*- coding: utf-8 -*-
Posted by: Guest on September-03-2021
0

decode utf8 whit python

import codecs
BLOCKSIZE = 1048576 # or some other, desired size in bytes
with codecs.open(sourceFileName, "r", "your-source-encoding") as sourceFile:
    with codecs.open(targetFileName, "w", "utf-8") as targetFile:
        while True:
            contents = sourceFile.read(BLOCKSIZE)
            if not contents:
                break
            targetFile.write(contents)
Posted by: Guest on April-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language