Closed andreasdoll closed 5 years ago
@andreasdoll I made two suggestions on how I think this should be implemented. Let me know if you need any help with this.
Thanks @jjhelmus, I wasn't aware that encodings in open() is not backwards compatible. I've modified that commit according to your wishes and added the previously forgotten parameter docstring.
LGTM, thanks @andreasdoll
Allow to provide a list of possible encodings for reading JCAMP files, and use the first encoding which doesn't raise an UnicodeDecodeError. Suppress such errors, except when all provided encodings fail. Keep the current behaviour by choosing the default encoding if no encoding is specified.
I'm not sure if you want to pull this, but for my purposes this is easier and more futureproof than converting the JCAMP files on operating system level.