Quasars / orange-spectroscopy

Other
51 stars 58 forks source link

File Reader Encoding #705

Closed nicholsonbt closed 6 months ago

nicholsonbt commented 7 months ago

Most file readers don't specify an encoding when opening files to read and the default python encoding for reading files is OS-dependent, meaning that some file readers may fail on certain operating systems. For example, the superscript minus sign that's used in some (new?) NeaSpec file formats to represent wavenumber units (cm⁻¹) is represented in UTF-8 but not CP1252 (the default Windows encoding for Europe), causing an error whilst loading the file in Windows. A simple solution for this would be to specify the required encoding when opening the file.

markotoplak commented 6 months ago

Yes, I agree. This OS-dependent loading is a bad habit of Python.

markotoplak commented 6 months ago

@nicholsonbt , could you please share a problematic file with me? Thanks.