wavefnd / wavefnd/Wave

Use Unicode Windows APIs for UTF-8 filesystem paths

Open
#525 0 comments 0 reactions 0 assignees View on GitHub
bug cross-platform help wanted
Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 22m
Merged PRs (30d)
46

Description

Wave source strings can contain UTF-8 names, while the Windows filesystem provider passes their bytes directly to `CreateFileA` and other narrow path APIs. There is no UTF-8/UTF-16 conversion. On a Windows configuration whose narrow API code page differs from UTF-8, non-ASCII filenames can be misinterpreted or fail to resolve. The same mismatch affects returned current-directory bytes.

Source evidence at the head of #520:

- [std/sys/windows/fs.wave:9](https://github.com/wavefnd/Wave/blob/2ae0a91c57fd76323124c0e4dff552adbfadbe1b/std/sys/windows/fs.wave#L9) — `CreateFileA`
- [std/sys/windows/fs.wave:176](https://github.com/wavefnd/Wave/blob/2ae0a91c57fd76323124c0e4dff552adbfadbe1b/std/sys/windows/fs.wave#L176) — `pub fun getcwd`

Acceptance:

- [ ] Use the native wide path APIs and explicit UTF-8/UTF-16 conversion for input and returned paths.
- [ ] Cover create/open/stat/rename/remove and current-directory round trips with Korean text and a supplementary-plane character.
- [ ] Check output capacities in the units exposed by the Wave API and release all conversion buffers on error.
- [ ] Do not require a process-wide UTF-8 code-page setting or introduce libc bindings.

API/reference context: [Windows file naming and Unicode APIs](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file).

Related: #385; the Windows environment block has a separate ownership and encoding path.

Audit status: identified by static source inspection; the scenarios above have not been executed during this audit. The permalink fixes the reviewed revision; this report does not claim the defect was introduced by #520.

Contributor guide

Open the contributing guide

Research direction

Start in std/sys/windows/fs.wave at the CreateFileA call near line 9 and the getcwd entry point near line 176, then consult the linked Windows Unicode API reference. Exercise create/open/stat/rename/remove and current-directory round trips with Korean and supplementary-plane names; done means wide APIs, explicit conversions, capacity checks, and error-path buffer cleanup without a process-wide code-page setting or libc bindings.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.