From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.bugs Subject: Re: cmdproxy.exe garbles special characters in environment variables Date: Mon, 25 Jun 2007 13:40:58 +0100 Message-ID: <467FB7DA.6070700@gnu.org> References: <467ED402.3090804@inf.fu-berlin.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1182775271 5669 80.91.229.12 (25 Jun 2007 12:41:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Jun 2007 12:41:11 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: =?ISO-8859-15?Q?G=FCnter_Rote?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 25 14:41:07 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I2nsR-0000Wh-0k for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jun 2007 14:41:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2nsQ-0000TX-CI for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jun 2007 08:41:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I2nsP-0000T5-AU for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2007 08:41:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I2nsN-0000Sg-Je for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2007 08:41:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2nsN-0000Sd-Fy for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2007 08:41:03 -0400 Original-Received: from outmail1.freedom2surf.net ([194.106.33.237]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I2nsN-0002FE-1n for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2007 08:41:03 -0400 Original-Received: from [127.0.0.1] (i-83-67-23-108.freedom2surf.net [83.67.23.108]) by outmail1.freedom2surf.net (Postfix) with ESMTP id 3F70B509D5; Mon, 25 Jun 2007 13:41:02 +0100 (BST) User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) In-Reply-To: <467ED402.3090804@inf.fu-berlin.de> X-detected-kernel: Linux 2.4-2.6 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15994 Archived-At: G=FCnter 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D '\\'; =20 + /* Due to problems with interaction between API functions that use "O= EM" + 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