summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--win/tclWinSock.c15
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 95c1a17..5e54f99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2007-11-27 Don Porter <dgp@users.sourceforge.net>
+ * win/tclWinSock.c: Add mising encoding conversion of the [info
+ hostname] value from the system encoding to Tcl's internal encoding.
+
* doc/chan.n: "Fix" the limitation on channel -eofchar
* doc/fconfigure.n: values to single byte characters by documenting
* generic/tclIO.c: it and making it fail loudly. Thanks to
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index d46bfc0..1d61eb6 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinSock.c,v 1.57 2007/02/20 23:24:07 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.58 2007/11/27 20:38:40 dgp Exp $
*/
#include "tclWinInt.h"
@@ -2576,13 +2576,18 @@ InitializeHostName(
* Maintainers are welcome to supply it.
*/
- Tcl_DStringSetLength(&ds, 255);
- if (winSock.gethostname(Tcl_DStringValue(&ds),
- Tcl_DStringLength(&ds)) == 0) {
+ Tcl_DString inDs;
+
+ Tcl_DStringInit(&inDs);
+ Tcl_DStringSetLength(&inDs, 255);
+ if (winSock.gethostname(Tcl_DStringValue(&inDs),
+ Tcl_DStringLength(&inDs)) == 0) {
Tcl_DStringSetLength(&ds, 0);
} else {
- Tcl_DStringSetLength(&ds, strlen(Tcl_DStringValue(&ds)));
+ Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&inDs),
+ Tcl_DStringLength(&inDs), &ds);
}
+ Tcl_DStringFree(&inDs);
}
}