Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HDF5-based format: update detection of HDF5 version for UTF-8-based f…
…ilenames (#237) A couple of years ago HDF5 changed its filename handling on Windows: instead of taking filenames in the local codepage (as previously), it now takes filenames in UTF-8 and converts them to wchar_t-based names, using the corresponding "Unicode" Windows API functions to access files. (This is to ensure that all stored files can be accessed, not just those with names representable in the local codepage.) matio also does the same since commit 6d47ebd. In contrast to the official release notes and documentation of HDF5, the first version of HDF5 that the change happend in was actually 1.10.6. This was commit 34adba4a0c131afe49a75e8e7d92f1e986c1b540 in the HDF5 repository, which is part of 1.10.6 and further. The commit itself appears to be a cherry-pick of other changes, so it is likely that this was not intentional back then, and that HDF5 1.12.0 was to be the first version with the change (hence the development version 1.11.6 for the check) -- however, this does not change the fact that in the actual releases this change was made already in 1.10.6. matio passes 8bit strings directly to HDF5, so the change itself is mostly transparent to matio (with matio just using the behavior of the underlying HDF5 library), but when writing .mat files matio does need to update the file header so that matlab recognizes it as a .mat (and not a generic HDF5 file). For that it needs to open the same file that was written by the HDF5 library previously. This commit updates the compiler check that detects which version of HDF5 is being used from 1.11.6 to 1.10.6, so that it correctly aligns with the behavior of HDF5. As reported by #237 Co-authored-by: Christian Seiler <[email protected]>
- Loading branch information