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

Fix bug in enforce_ascii_hack. #856

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions include/highfive/bits/H5ReadWrite_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@
// TEMP. CHANGE: Ensure that the character set is properly configured to prevent
// converter issues on HDF5 <=v1.12.0 when loading ASCII strings first.
// See https://github.com/HDFGroup/hdf5/issues/544 for further information.
if (H5Tget_cset(src.getId()) == H5T_CSET_ASCII) {
H5Tset_cset(dst.getId(), H5T_CSET_ASCII);

bool is_dst_string = H5Tget_class(dst.getId()) == H5T_STRING;
bool is_src_string = H5Tget_class(src.getId()) == H5T_STRING;

if (is_dst_string && is_src_string) {
if (H5Tget_cset(src.getId()) == H5T_CSET_ASCII) {
H5Tset_cset(dst.getId(), H5T_CSET_ASCII);

Check warning on line 85 in include/highfive/bits/H5ReadWrite_misc.hpp

View check run for this annotation

Codecov / codecov/patch

include/highfive/bits/H5ReadWrite_misc.hpp#L85

Added line #L85 was not covered by tests
}
}
}

Expand Down