Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1134

Convert to UTF-8-BOM memory optimiztion

$
0
0

Is there a better way to write this code section in Python with an emphasis on memory usage?convert csv from UTF-8 to UTF-8-BOM ( work better with Hebrew )

def convert_csv_to_utf8_bom(input_file_path, output_file_path, logger: Logger):"""Convert a CSV file format to UTF 8 Bom """logger.debug(f"convert csv to utf8 bom")with open(input_file_path, "r", encoding="utf-8") as f:    content = f.read()with open(output_file_path, "w", encoding="utf-8-sig") as f:    f.write(content)

Viewing all articles
Browse latest Browse all 1134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>