git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/2] Let's use the Win32 API more precisely

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 27, 2019, 09:37 UTC
Message-ID
<pull.147.git.gitgitgadget@gmail.com>

For many Win32 functions, there actually exist two variants: one that takes const char * ("ANSI", meaning the current code page) and wchar_t * ("Unicode", i.e. UTF-16, at least for all practical matters).

These functions have "A" and "W" suffixes, respectively, e.g. GetFileAttributesW(). The symbols without this suffix are #defined to the *W() versions if the constant UNICODE is defined before including the Windows headers, and to *A() otherwise.

Let's not rely on this constant, but explicitly say what we want: we want the Unicode versions, as they seem to be used by the ANSI flavor anyway.

Johannes Schindelin (2):
  mingw: get pw_name in UTF-8 format
  mingw: use Unicode functions explicitly
 compat/mingw.c     | 12 +++++++++---
 compat/poll/poll.c |  2 +-
 compat/winansi.c   | 10 ++++++----
 3 files changed, 16 insertions(+), 8 deletions(-)
base-commit: aa25c82427ae70aebf3b8f970f2afd54e9a2a8c6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-147%2Fdscho%2Fansi-unicode-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-147/dscho/ansi-unicode-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/147
-- 
gitgitgadget
Next: Johannes Schindelin via GitGitGadget
Message 1 of 8 in “Let's use the Win32 API more precisely”
  1. 0/2 Let's use the Win32 API more preciselyJohannes Schindelin via GitGitGadget, Jun 27, 2019
  2. 1/2 mingw: get pw_name in UTF-8 formatJohannes Schindelin via GitGitGadget, Jun 27, 2019
  3. Beat BolliJul 4, 2019
  4. Johannes SchindelinJul 4, 2019
  5. Beat BolliJul 4, 2019
  6. 2/2 mingw: use Unicode functions explicitlyJohannes Schindelin via GitGitGadget, Jun 27, 2019
  7. Eric SunshineJun 27, 2019
  8. Johannes SchindelinJun 27, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.