sphobjinv icon indicating copy to clipboard operation
sphobjinv copied to clipboard

Re-evaluate usage of encoding throughout the package

Open bskinn opened this issue 6 years ago • 1 comments

Right now many things internally are coerced to using UTF-8. This may be fine! Occurrences of encoding collisions may be infrequent enough that it might as well be a YAGNI to do this.

But, it would be a good opportunity to strengthen understanding of when to handle encodings in which way(s).

bskinn avatar Oct 15 '19 13:10 bskinn

Sphinx specifically encodes the compressed objects.invs using Python's default encoding of UTF-8. Thus, import of compressed inventories should always work with UTF-8, and the code does not need to be changed on the compressed inventory side.


The big question is then the encoding used for read/write of decompressed inventories.

Currently, looks like the code is based around read/write of UTF-8 encoded plaintext (see here and here). The big change would be to add arguments allowing the user to specify whatever desired encoding for read/write, including adding an option to the CLI.

bskinn avatar May 14 '20 14:05 bskinn