Add encoding argument to scripts - #10
Conversation
|
Let me know if we'd like to respect the default encoding of the system, where the solution would have to be some change in the polars write to csv code |
|
Hi @BazookaMusic, thank you. It was a similar suggestion by @Askill. However, to make sure it will not break for other users, how about we add a new argparse argument (--encoding) where the default is None but we give a chance to other users to set what encoding they prefer? Then on the other scripts we would need to have argparse arguments such as --input (for input file, the default is measurements.txt) and --encoding (default is None) |
|
@ifnesi Done and done |
|
However, it doesn't make sense to add a flag for encoding for the other scripts as they assume that the file is in utf-8 already. Binary mode reading does not support passing an encoding parameter. Also the code does comparisons like: See also: |
Issue
On Windows 11, the measurement creation script failed on my machine with polars complaining that the file created is not in utf-8 encoding.
Solution
Force a utf-8 encoding so that polars can read the file, since it defaults to utf-8.
Error message: