localcharset: Add comment.
authorBruno Haible <bruno@clisp.org>
Sat, 12 Dec 2009 13:46:27 +0000 (14:46 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 12 Dec 2009 13:46:27 +0000 (14:46 +0100)
ChangeLog
lib/localcharset.c

index 7aaf2de3b2034488ec0c80beab60abd49da4b80b..110f69798716425da5a82b9aa11dec3ee7e0cbfe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-12  Bruno Haible  <bruno@clisp.org>
+
+       * lib/localcharset.c (locale_charset): Add comment about use of GetACP.
+
 2009-12-11  Eric Blake  <ebb9@byu.net>
 
        setenv: relax requirement in light of POSIX ruling
index c8873b565f2ab56a89f6e11d36b0814828115949..b70fa215b268ee3f1bed5a07af13d90ee89f9f56 100644 (file)
@@ -449,7 +449,19 @@ locale_charset (void)
 
   static char buf[2 + 10 + 1];
 
-  /* Woe32 has a function returning the locale's codepage as a number.  */
+  /* Woe32 has a function returning the locale's codepage as a number.
+     When the output goes to a console window, in Windows 95, it would have
+     been appropriate to use GetOEMCP() instead of GetACP().  But this has
+     been corrected: In Windows XP SP3, consoles accept output in the
+     GetACP() encoding.  The GetConsoleOutputCP() function still returns
+     the same as GetOEMCP() (not GetACP()!), but the font handling in the
+     console actually uses the GetACP() encoding.  If you want to "correct"
+     this by calling SetConsoleOutputCP(GetACP()), then for a TrueType font
+     it has no visible effect on the displayed glyphs, whereas when a raster
+     font is in use, the console performs an extra conversion from GetOEMCP()
+     to GetACP() encoding, thus changing the effective codepage of the
+     console from GetACP() to GetOEMCP()!  In summary, GetConsoleOutputCP()
+     and SetConsoleOutputCP() are now completely broken.  */
   sprintf (buf, "CP%u", GetACP ());
   codeset = buf;