I have done some research on this issue. The "correct" behavior seems
to be to match what Windows would do in cmd.exe. That would provide
the users with the least surprise.

Michael Kaplan's guidance[1] on file names seems to also describe how
Windows handles names of environment variables:

> For the uppercasing operation, you can use CharUpper, CharUpperBuff, or 
> LCMapString
> with the LCMAP_UPPERCASE flag (and *without* the LCMAP_LINGUISTIC_CASING 
> flag!).
> (emphasis in the original)

To test whether the same applied to names of environment variables as
well, I set the user locale to Turkish, and verified that iş was
mapped to IŞ and not İŞ on a computer where the OS code page was not
Turkish.

The most straightforward function to use is thus CharUpperBuffW[2].

[1]: http://archives.miloush.net/michkap/archive/2005/10/17/481600.html
[2]: 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms647475(v=vs.85).aspx

Reply via email to