@@ -0,0 +1,1153 @@
+# coding=utf-8%0Aimport os%0Afrom shutil import copyfileobj%0Afrom sys import argv%0Afrom tqdm import tqdm%0A%0A%0Adef main(src_folder, src_encoding, dest_folder, dest_encoding):%0A    src_folder = os.path.abspath(src_folder)%0A    dest_folder = os.path.abspath(dest_folder)%0A%0A    for root, dirs, files in os.walk(src_folder):%0A        to_root = dest_folder + root%5Blen(src_folder):%5D%0A        if not os.path.exists(to_root):%0A            os.makedirs(to_root)%0A%0A        print(%22Copying %7B%7D to %7B%7D%22.format(repr(root.encode('utf-8')), repr(to_root.encode('utf-8'))))%0A        for filename in tqdm(files, unit=%22files%22):%0A            frompath = os.path.join(root, filename)%0A            topath = os.path.join(to_root, filename)%0A            try:%0A                with open(frompath, 'r', encoding=src_encoding) as source, %5C%0A                        open(topath, 'w', encoding=dest_encoding) as destination:%0A                    copyfileobj(source, destination)%0A            except UnicodeDecodeError as ex:%0A                print(%22Unicode error on file %7B%7D%22.format(repr(frompath.encode('utf-8'))))%0A                print(ex)%0A%0A%0Aif __name__ == '__main__':%0A    main(*argv%5B1:%5D)  # todo: use argparse%0A

add tool for bulk recoding text files into a different unicode format