fix for #243#244
Open
Stemt wants to merge 6 commits into
Open
Conversation
added 5 commits
May 18, 2026 11:46
… api to use utf16 strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added:
char utf8_name[MAX_PATH]buffer inside Nob_Dir_Entry.nob__private.I changed:
FindFirstFileinsidenob_dir_entry_opentoFindFirstFileW.FindNextFileinsidenob_dir_entry_nexttoFindNextFileW.WIN32_FIND_DATAinsideNob_Dir_Entry.nob__privatetoWIN32_FIND_DATAW.GetCurrentDirectoryinsidenob_get_current_dir_tempwithGetCurrentDirectoryW.I tried to keep the memory allocation consistent with the previous behaviour.
So inside
get_current_dir_temp()I use the temp allocator for a temporary utf16 buffer, but in the nob_dir_entry functions it uses a the newutf8_namebuffer which takes the place of theWIN32_FIND_DATAA.cFileNamebuffer.This has the disadvantage that valid file names might not fit inside this new buffer but I think this is a decent compromise as opposed to requiring the use of the temp allocator for example.
To validate that this works I wrote quick little test:
Here is the result before the change:
Here is the result after the change: