Repository navigation
0.1.1: names reach the system as UTF-8, never through the code page - #4
Merged
Merged
Conversation
path::generic_string() and path::string() narrow through the ANSI code page on Windows (MSVC): a name the code page cannot spell throws, which ended a program at once (0xC0000409), and a name it can spell reached openkal-windows as ANSI bytes, while openkal reads names as UTF-8 (MultiByteToWideChar CP_UTF8). path(std::string) made the same mistake on the way back. os::fs::utf8, generic_utf8 and from_utf8 are the conversions, and every name in fs, process, env, dirs, ipc and the Windows module goes through them (README R7). fs_test writes, reads, replaces and renames a file whose directory and name are in four scripts, and checks that an error names the file in UTF-8. Found by openmui's tests, which save and list files under non-ASCII names on Windows.
Sunrisepeak
added a commit
to mcpplibs/mcpp-index
that referenced
this pull request
Oct 27, 2026
* mcpplibs.os 0.1.1: names reach the system as UTF-8, never through the code page The patch release of mcpplibs/os#4. On Windows, 0.1.0 narrowed names through the ANSI code page: a name it could not spell ended the program, and one it could spell reached openkal (which reads UTF-8) wrongly. The tests/examples/os consumer moves to 0.1.1 and writes and reads a file whose name is not ASCII. * mcpplibs.os: automatic updates follow the repository's version tags
Sunrisepeak
added a commit
to Sunrisepeak/mui
that referenced
this pull request
Oct 27, 2026
…te names openmui's tests save sessions and list endpoints under non-ASCII names. On Windows (MSVC) mcpplibs.os 0.1.0 narrowed those names through the ANSI code page and ended the program (0xC0000409). os 0.1.1 (mcpplibs/os#4, mcpp-index #580) passes names as UTF-8 throughout. The viewer makes a name absolute before it reads it: on Windows `\docs` is on the current drive.
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.
On Windows (MSVC),
path::generic_string()andpath::string()narrow through the ANSI code page:MultiByteToWideChar(CP_UTF8, …)), so the file opened is the wrong one.path(std::string)repeats the mistake on the way back (environment values, link names, endpoint names).This PR:
os::fs::utf8,generic_utf8andfrom_utf8, and routes every name through them: the 40 sites in fs, process, env, dirs, ipc and the Windows module (README rule R7);fs_testto write, read, replace and rename a file whose directory and name are in four scripts, and to check that an error names the file in UTF-8;It is based on
main, so the open 0.2.0 branch (#3) can merge it forward.