This PR addresses an issue where the Gwy file loader couldn't load some images - see @zhengyw123's post on discussions.
The issue stemmed from a μ (micro) character used in the file, where the UTF-8 standard was unable to decode it.
Here's a proof of concept of the bug to illustrate the issue:
I have solved this by simply adding a fallback to using the ISO 8859-1 standard which is able to decode this character, if TopoStats comes across such a character while reading a null-terminated-string.
While I was at it, I added channel support for .gwy files as I lazily didn't add it initially.
Closes #832
This PR addresses an issue where the Gwy file loader couldn't load some images - see @zhengyw123's post on discussions.
The issue stemmed from a μ (micro) character used in the file, where the
UTF-8
standard was unable to decode it.Here's a proof of concept of the bug to illustrate the issue:![image](https://github.com/AFM-SPM/TopoStats/assets/86117496/5dd66eca-7bac-423d-b0ed-1219cebc9026)
I have solved this by simply adding a fallback to using the
ISO 8859-1
standard which is able to decode this character, if TopoStats comes across such a character while reading a null-terminated-string.While I was at it, I added channel support for
.gwy
files as I lazily didn't add it initially.