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

IOError while trying to open rocksdb with a path that include diacritic characters on Windows. #10759

Closed
Nanda2412 opened this issue Sep 29, 2022 · 1 comment

Comments

@Nanda2412
Copy link

Nanda2412 commented Sep 29, 2022

I am using rocksdb v7.5. The db open fails on Win if we use diacritic characters in the folder name.

./ldb --db=C:/Desktop/Sévigné --create_if_missing put a1 b1
Failed: IO error: No such file or directory: Failed to create a directory: C:/Desktop/SΘvignΘ: The system cannot find the path specified.

The same operation works fine on Mac.

Expected behavior

db should open without any issues even if the folder name contains diacritic characters

Actual behavior

db open failed

Steps to reproduce the behavior

./ldb --db=C:/Desktop/Sévigné --create_if_missing put a1 b1
Failed: IO error: No such file or directory: Failed to create a directory: C:/Desktop/SΘvignΘ: The system cannot find the path specified.

@Nanda2412
Copy link
Author

Duplicate issue. Enabling WITH_WINDOWS_UTF8_FILENAMES in the CMakeLists.txt and rebuilding rocksdb library fixed the issue.

Before:

option(WITH_WINDOWS_UTF8_FILENAMES "use UTF8 as characterset for opening files, regardles of the system code page" OFF)
if (WITH_WINDOWS_UTF8_FILENAMES)
  add_definitions(-DROCKSDB_WINDOWS_UTF8_FILENAMES)
endif()

After:

option(WITH_WINDOWS_UTF8_FILENAMES "use UTF8 as characterset for opening files, regardles of the system code page" ON)
if (WITH_WINDOWS_UTF8_FILENAMES)
  add_definitions(-DROCKSDB_WINDOWS_UTF8_FILENAMES)
endif()

Related discussions:

  1. Add compile time option to work with utf8 filename strings #4469
  2. "IO error: Failed to create dir: Invalid argument" when having non-latin characters in folder name (only on windows) Level/rocksdb#40
  3. Opening filenames with Unicode on Windows not possible #3408

Closing the issue.

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

No branches or pull requests

1 participant