diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-24 07:56:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-24 07:56:41 (GMT) |
commit | bc56730d2abae5198c3667a55729e01684f3cb29 (patch) | |
tree | a67f18bf70f2081877ab48b4aecd142c54848262 /generic/tkMain.c | |
parent | abbe37191732849b4d22072a8572f29205025457 (diff) | |
download | tk-bc56730d2abae5198c3667a55729e01684f3cb29.zip tk-bc56730d2abae5198c3667a55729e01684f3cb29.tar.gz tk-bc56730d2abae5198c3667a55729e01684f3cb29.tar.bz2 |
Replace all instances of Tcl_WinTCharToUtf()/Tcl_WinUtfToTChar() with Tcl_UniCharToUtfDString()/Tcl_UtfToUniCharDString(), if possible (only for -DTCL_UTF_MAX=3, which is the default and only supported option)
Backported, as far as possible, from 8.7. This helps moving away from Tcl_WinTCharToUtf()/Tcl_WinUtfToTChar(), even though it only becomes deprecated in 8.7.
Diffstat (limited to 'generic/tkMain.c')
-rw-r--r-- | generic/tkMain.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tkMain.c b/generic/tkMain.c index 784f2f8..c6c9835 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -70,8 +70,9 @@ NewNativeObj( Tcl_Obj *obj; Tcl_DString ds; -#ifdef UNICODE - Tcl_WinTCharToUtf(string, -1, &ds); +#if defined(_WIN32) && defined(UNICODE) + Tcl_DStringInit(&ds); + Tcl_WCharToUtfDString(string, wcslen(string), &ds); #else Tcl_ExternalToUtfDString(NULL, (char *) string, -1, &ds); #endif @@ -401,17 +402,18 @@ Tk_MainEx( *---------------------------------------------------------------------- */ - /* ARGSUSED */ static void StdinProc( ClientData clientData, /* The state of interactive cmd line */ int mask) /* Not used. */ { char *cmd; - int code, count; - InteractiveState *isPtr = clientData; + int code; + int count; + InteractiveState *isPtr = (InteractiveState *)clientData; Tcl_Channel chan = isPtr->input; Tcl_Interp *interp = isPtr->interp; + (void)mask; count = Tcl_Gets(chan, &isPtr->line); |