From: "Günter Rote" <rote@inf.fu-berlin.de>
To: bug-gnu-emacs@gnu.org
Subject: cmdproxy.exe garbles special characters in environment variables
Date: Sun, 24 Jun 2007 22:28:50 +0200 [thread overview]
Message-ID: <467ED402.3090804@inf.fu-berlin.de> (raw)
1) DESCRIPTION OF THE PROBLEM:
After buying a new computer with Windows vista operating system and
installing the latest emacs, I could no longer call LaTeX from emacs.
(with the error message:
"latex: The file system path could not be retrieved."
2) DIAGNOSIS:
Since it worked, strangely, with other accounts on my computer, I
eventually found the following reason: I am in the unlucky position that
I have chosen an account name with an Umlaut. (Günter)
cmdproxy.exe garbles these special characters in environment variables,
thus causing TeX (I am using MIKTeX) to fail because it cannot access
settings that are stored in my home directory:
Here is a test run:
==========================
Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. Alle Rechte vorbehalten.
C:\Users\Günter>set userprofile
USERPROFILE=C:\Users\Günter
C:\Users\Günter>"\Program Files\emacs-22.1\bin\cmdproxy.exe"
Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. Alle Rechte vorbehalten.
C:\Users\Günter>set userprofile
USERPROFILE=C:\Users\G?nter
C:\Users\Günter>tex
tex: The file system path could not be retrieved.
C:\Users\Günter>set userprofile=C:\users\günter
C:\Users\Günter>tex
This is TeX, Version 3.141592 (MiKTeX 2.5)
**
==============================
(In case this gets garbled by the mailer: the first USERPROFILE
shows the umlaut (ü), the second one a question mark.)
3) POSSIBLE CAUSE:
in the code for cmdproxy.exe on
http://www.koders.com/c/fid9819664E76F7A0D978AEDF36E6B52EE58A477EC8.aspx?s=add#L379
contains the following snippet:
/* In theory, passing NULL for the environment block to CreateProcess
is the same as passing the value of GetEnvironmentStrings, but
doing this explicitly seems to cure problems running DOS programs
in some cases. */
char * envblock = GetEnvironmentStrings ();
which is then passed to CreateProcess(...)
Apparently there is a clash between different coding conventions.
Here is some information that I found (I don't know with what system
cmdproxy.c has been compiled)
According to http://msdn2.microsoft.com/en-us/library/ms683187.aspx
there are two versions of GetEnvironmentStrings:
"Implemented as GetEnvironmentStringsW (Unicode) and
GetEnvironmentStringsA (ANSI)."
http://msdn2.microsoft.com/en-us/library/ms682425.aspx
says about the lpEnvironment parameter of CreateProcess:
An environment block can contain either Unicode or ANSI characters. If
the environment block pointed to by lpEnvironment contains Unicode
characters, be sure that dwCreationFlags includes
CREATE_UNICODE_ENVIRONMENT. If this parameter is NULL and the
environment block of the parent process contains Unicode characters, you
must also ensure that dwCreationFlags includes CREATE_UNICODE_ENVIRONMENT.
http://msdn2.microsoft.com/en-us/library/ms684863.aspx says about this flag:
CREATE_UNICODE_ENVIRONMENT 0x00000400
If this flag is set, the environment block pointed to by lpEnvironment
uses Unicode characters. Otherwise, the environment block uses ANSI
characters.
Windows Me/98/95: This value is not supported.
[ 4) WORKAROUND.
I have so far been using batch files for tex, latex, yap, etc. that
set the environment variables before calling the programs themselves.
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 ]
This error has been a nuisance, and it took me a while to find the
cause. Since it will only show up for few users, it will be difficult to
diagnose.
With best regards
--
G"unter Rote (Germany=49)30-838-75150 (office)
Freie Universit"at Berlin
Institut f"ur Informatik FAX (49)30-838-75192
Takustrase 9
D-14195 Berlin, GERMANY
next reply other threads:[~2007-06-24 20:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-24 20:28 Günter Rote [this message]
2007-06-25 8:57 ` cmdproxy.exe garbles special characters in environment variables Jason Rumney
2007-06-25 12:40 ` Jason Rumney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=467ED402.3090804@inf.fu-berlin.de \
--to=rote@inf.fu-berlin.de \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.