summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--win/tclWinFile.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a21b3a6..9bc2e7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tclWinFile.c (TclpFindExecutable): when using
+ GetModuleFileNameA (Win9x), convert from CP_ACP to WCHAR then
+ convert back to utf8. Adjunct to 2004-04-07 fix.
+
2004-06-02 David Gravereaux <davygrvy@pobox.com>
* tests/winPipe.c (winpipe-6.1): blocking set to 1 before
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index e527290..05462ed 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinFile.c,v 1.64 2004/05/19 22:41:22 kennykb Exp $
+ * RCS: @(#) $Id: tclWinFile.c,v 1.65 2004/06/02 23:29:30 hobbs Exp $
*/
//#define _WIN32_WINNT 0x0500
@@ -702,10 +702,12 @@ TclpFindExecutable(argv0)
if (GetModuleFileNameW(NULL, wName, MAX_PATH) == 0) {
GetModuleFileNameA(NULL, name, sizeof(name));
- } else {
- WideCharToMultiByte(CP_UTF8, 0, wName, -1,
- name, sizeof(name), NULL, NULL);
+ /*
+ * Convert to WCHAR to get out of ANSI codepage
+ */
+ MultiByteToWideChar(CP_ACP, 0, name, -1, wName, MAX_PATH);
}
+ WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL);
tclNativeExecutableName = ckalloc((unsigned) (strlen(name) + 1));
strcpy(tclNativeExecutableName, name);