sphobjinv
sphobjinv copied to clipboard
Re-evaluate usage of encoding throughout the package
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).
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.