bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cmdproxy.exe garbles special characters in environment variables


From: Jason Rumney
Subject: Re: cmdproxy.exe garbles special characters in environment variables
Date: Mon, 25 Jun 2007 13:40:58 +0100
User-agent: Thunderbird 2.0.0.4 (Windows/20070604)

Günter Rote wrote:
> I will try to compile a patched version of cmdproxy.exe that works for
> me. (It may mess up those DOS programs that are mentioned in cmdproxy.c ]

Please try the following patch. It seems to work in the limited testing
I have done, but I have not tried non-ASCII characters in the username,
only in dummy test environment variables.


Index: cmdproxy.c
===================================================================
RCS file: /sources/emacs/emacs/nt/cmdproxy.c,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -c -r1.17 -r1.17.2.1
*** cmdproxy.c    16 Jan 2007 01:41:57 -0000    1.17
--- cmdproxy.c    25 Jun 2007 12:30:27 -0000    1.17.2.1
***************
*** 466,471 ****
--- 466,477 ----
    SetCurrentDirectory (modname);
    *progname = '\\';
 
+   /* Due to problems with interaction between API functions that use "OEM"
+      codepage vs API functions that use the "ANSI" codepage, we need to
+      make things consistent by choosing one and sticking with it.  */
+   SetConsoleCP (GetACP());
+   SetConsoleOutputCP (GetACP());
+
    /* Although Emacs always sets argv[0] to an absolute pathname, we
       might get run in other ways as well, so convert argv[0] to an
       absolute name before comparing to the module name.  Don't get





reply via email to

[Prev in Thread] Current Thread [Next in Thread]