nob_read_entire_dir corrupts filenames containing wide UTF charachters on Windows
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- c
- Domain
- build-system, tooling
Research direction
Start in nob.h at nob_read_entire_dir and inspect its FindFirstFile/FindNextFile calls in the Windows path. Reproduce the issue in the MSYS2 UCRT64 environment with filenames containing wide UTF characters, then trace how the names are returned and encoded. Done means those filenames remain intact and are represented as UTF-8.
Written by the indexing model from the issue text.
Description
I'm using the mingw compiler in a MSYS2 UCRT64 environment.
I dont have a lot of experience with the Win32 api but I've got it narrowed down to the FindFirstFile/FindNextFile of which probably the narrow versions are being used.
These seem to truncate the individual charachters by dropping the extra byte instead of doing something sensible like throwing an error.
nob.h should probably be explicitly using the wide versions of these functions and converting them to utf-8.
I will try to work out a sensible solution.
- Dominant language
- C++
- Stars
- 3.3k
- Forks
- 214
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tsoding/nob.h
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
nob__walk_dir_opt_impl() tries to close zeroed handle for non directory entriesPossibly taken @whophi claimed this 59 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
espressif/esp-matter#1874 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opencv/opencv_contrib#4231 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MiSTer-devel/Main_MiSTer#1341 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
linux-test-project/lcov#552 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
Maintainers usually reply within 1 day