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

Regression with 1.14.4-3 H5Fcreate opens and close file with wide chars (example chinese characters) #4599

Open
Nelson-numerical-software opened this issue Jun 22, 2024 · 2 comments
Assignees
Labels
Component - C Library Core C library issues (usually in the src directory) Priority - 0. Blocker ⛔ This MUST be merged for the release to happen Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub
Milestone

Comments

@Nelson-numerical-software
Copy link

Nelson-numerical-software commented Jun 22, 2024

Previously with 1.12.1 on windows x64 build, this code works as expected
with filename = L'漢字.nh5'

    std::string utf_filename = wstring_to_utf8(filename);
    hid_t plist_id = H5Pcreate(H5P_FILE_CREATE);
    H5Pset_userblock(plist_id, 512);
    hid_t plist_ap = H5Pcreate(H5P_FILE_ACCESS);
#if H5_VERSION_GE(1, 10, 2)
    H5Pset_libver_bounds(plist_ap, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18);
#endif
    hid_t fid = H5Fcreate(utf_filename.c_str(), H5F_ACC_TRUNC, plist_id, plist_ap);
    // fid OK no error
    H5Pclose(plist_id);
    herr_t status = H5Fclose(fid);
    if (status < 0) {
     delete[] header_offset;
     delete[] header_saturated;
     return -1;
    }
   // status OK
  #ifdef _MSC_VER
    FILE* fp = _wfopen(filename.c_str(), L"r+b");
#else
    FILE* fp = fopen(utf_filename.c_str(), "r+b");
#endif
    if (fp == nullptr) {
   // HERE FILE WAS NOT CREATED !!!
    }

file was not created by H5FCreate

What do I miss ?

@Nelson-numerical-software Nelson-numerical-software changed the title Regression with 1.14.4-3 H5Fcreate opens and close file with wide chars (example chinese characters) d Regression with 1.14.4-3 H5Fcreate opens and close file with wide chars (example chinese characters) Jun 22, 2024
@byrnHDF byrnHDF added Priority - 0. Blocker ⛔ This MUST be merged for the release to happen Component - C Library Core C library issues (usually in the src directory) labels Jun 24, 2024
@Nelson-numerical-software
Copy link
Author

any news ?

@derobins derobins added the Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub label Aug 15, 2024
@derobins derobins added this to the 1.14.5 milestone Aug 29, 2024
@derobins derobins modified the milestones: 1.14.5, 2.0.0 Oct 15, 2024
@takluyver
Copy link
Contributor

I think I have tracked down the cause of this - see #5037. Thanks @jhendersonHDF for pointing me to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Priority - 0. Blocker ⛔ This MUST be merged for the release to happen Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub
Projects
None yet
Development

No branches or pull requests

4 participants