Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

nob_read_entire_dir corrupts filenames containing wide UTF charachters on Windows

Open
#243 1 comment 0 reactions 0 assignees View on GitHub

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

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tsoding/nob.h

All issues in tsoding/nob.h

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.