Quantcast
Viewing all articles
Browse latest Browse all 5091

Python • Re: Output to .csv file in Chinese? Characters

My version of Libre Office Calc was defaulting to 'Unicode (UTF-16)' when I try to open a .csv file, which results in what look like Chinese characters.
In my testing, LibreOffice correctly auto-detects between UTF-8 and UTF-16, and pre-sets the drop-down to the right option.

However, if I create a file in a legacy single-byte encoding such as ISO-8859-1, and the file includes high non-ASCII characters, then because such a sequence could not be valid UTF-8, but could be UTF-16, LibreOffice makes a bad guess.

Check that the output of locale says .UTF-8 everywhere, and you are not using any legacy encodings in your Python code.

Statistics: Posted by jojopi — Sun Oct 13, 2024 10:41 pm



Viewing all articles
Browse latest Browse all 5091

Trending Articles