Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDF5-based format: update detection of HDF5 version for UTF-8-based filenames #237

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

chris-se
Copy link
Contributor

@chris-se chris-se commented Feb 8, 2024

As discussed in #236 here is the dependent change that updates the minimum HDF5 version to 1.10.6. The commit message contains a longer explanation for the rationale behind the change.

…ilenames

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.
@tbeu tbeu merged commit 2145b1e into tbeu:master Feb 8, 2024
7 of 10 checks passed
@tbeu
Copy link
Owner

tbeu commented Feb 8, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants