Skip to content

0.4.6: the text another program writes, as UTF-8 - #26

Merged
Sunrisepeak merged 1 commit into
mainfrom
text-0.4.6
Nov 19, 2026
Merged

Sunrisepeak merged 1 commit into
mainfrom
text-0.4.6

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

mcpplibs.os.text decodes the text a started program writes into UTF-8 by the encoding it writes in: utf8, or console, the convention of Windows console programs, which write to a pipe or a file in the output code page of the console they are attached to and in the system's ANSI code page when they are attached to none. Measured with cl.exe and link.exe on windows-2022 (mcpp-community/mcpp#971, run 44508574496): under consoles in 437, 1252, 936 and 65001 each wrote in the console's page, with no console in the system's 1252. The page is read where the program is started, which the program inherits; a sequence that is no character of the page becomes a replacement character, and valid_utf8 replaces each sequence that is not UTF-8 with U+FFFD, a maximal subpart at a time. windows::console_text_code_page and windows::utf8_from_code_page are the two facts beneath it. mcpp uses it to read the text of MSVC tools (mcpp-community/mcpp#970). The tests run on every target, the conversions of the probe's bytes on Windows.

mcpplibs.os.text decodes a program's text by the encoding it writes in: UTF-8, or the convention
of Windows console programs, which write to a pipe or a file in the output code page of the
console they are attached to and in the system's ANSI code page when attached to none, as
measured with cl.exe and link.exe (mcpp-community/mcpp#970). The page is read where the program
is started; a sequence that is no character of it becomes a replacement character, and
valid_utf8 replaces each sequence that is not UTF-8 with U+FFFD, a maximal subpart at a time.
windows::console_text_code_page and windows::utf8_from_code_page are the facts beneath it.
@Sunrisepeak
Sunrisepeak merged commit eb77a41 into main Nov 19, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant