~skeeto/public-inbox

1

busybox-w32 and UTF-8

Details
Message ID
<20211229171101.l5doxlbr5jysfy53@nullprogram.com>
DKIM signature
missing
Download raw message
Hey, Ron. I recently learned about a relatively new Windows feature to set 
the "Active Code Page" for processes to UTF-8 when they're started, which 
causes most ANSI Win32 encode Unicode strings as UTF-8, notably including 
GetCommandLineA() and CreateFileA(). Since every Windows C and C++ runtime 
hooks up the to the ANSI API, this means C and C++ programs are upgraded 
to support Unicode the same way they do on every other platform, and 
Windows doesn't require so much special handling. They get UTF-8-encoded 
arguments and can access Unicode paths via UTF-8. Even busybox-w32 can 
take advantage of this, at least to some extent.

In case you're interested, I elaborated on it in this issue:
https://github.com/skeeto/w64devkit/issues/15

Unfortunately, this does not cover ReadConsoleA() nor ReadFile() on a 
console.
Ron Yorston <rmy@pobox.com>
Details
Message ID
<61cdbde6.NnF9APL0p+m+SEqL%rmy@pobox.com>
In-Reply-To
<20211229171101.l5doxlbr5jysfy53@nullprogram.com> (view parent)
DKIM signature
pass
Download raw message
Chris,

Thanks for the info.  I'll add it my my list of things to think about.

Cheers,

Ron
Reply to thread Export thread (mbox)