This PR resolves #112 by adding an optional encoding parameter to io.load_tabby. The parameter can be used to specify encoding for reading tsv files.
When not specified (encoding=None), we keep the default behavior (implicitly using locale.getencoding()^1,^2).
With external libraries it might be possible to guess a file encoding that produces a correct result based on the files content, but the success is not guaranteed when there are few non-ascii characters in the entire file (think: list of authors). I made an attempt with #114 but didn't like it in the end. Here, we do not attempt to guess, instead expecting the user to know the encoding they need to use.
This PR also fixes an unrelated documentation typo to satisfy the codespell checks.
This PR resolves #112 by adding an optional
encoding
parameter toio.load_tabby
. The parameter can be used to specify encoding for reading tsv files.When not specified (
encoding=None
), we keep the default behavior (implicitly usinglocale.getencoding()
^1,^2).With external libraries it might be possible to guess a file encoding that produces a correct result based on the files content, but the success is not guaranteed when there are few non-ascii characters in the entire file (think: list of authors). I made an attempt with #114 but didn't like it in the end. Here, we do not attempt to guess, instead expecting the user to know the encoding they need to use.
This PR also fixes an unrelated documentation typo to satisfy the codespell checks.