summaryrefslogtreecommitdiffstats
path: root/generic/tclMain.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclMain.c')
-rw-r--r--generic/tclMain.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/generic/tclMain.c b/generic/tclMain.c
index 4b8fa8c..4a66793 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -70,10 +70,8 @@ NewNativeObj(
Tcl_DString ds;
#ifdef UNICODE
- if (length > 0) {
- length *= sizeof(WCHAR);
- }
- Tcl_WinTCharToUtf(string, length, &ds);
+ Tcl_DStringInit(&ds);
+ Tcl_WCharToUtfDString(string, length, &ds);
#else
Tcl_ExternalToUtfDString(NULL, (char *) string, length, &ds);
#endif