diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-02-25 16:44:51 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-02-25 16:44:51 (GMT) |
commit | fe390a6d4c91cbdf82196b45375d9c40299b8de7 (patch) | |
tree | c4ccacd836e3485c275d158175df93400de5aac7 | |
parent | 1c66ee595842f0b5306eae0aaa7798d9fc018e1a (diff) | |
parent | 0eb68c7b8271c5fe018e7b2a992ac1def4598879 (diff) | |
download | tk-fe390a6d4c91cbdf82196b45375d9c40299b8de7.zip tk-fe390a6d4c91cbdf82196b45375d9c40299b8de7.tar.gz tk-fe390a6d4c91cbdf82196b45375d9c40299b8de7.tar.bz2 |
Merge 8.6
-rw-r--r-- | generic/tkClipboard.c | 8 | ||||
-rw-r--r-- | generic/tkCmds.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXClipboard.c | 8 |
3 files changed, 12 insertions, 10 deletions
diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 703ef41..8bc4237 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -708,7 +708,13 @@ ClipboardGetProc( * used). */ const char *portion) /* New information to be appended. */ { - Tcl_DStringAppend((Tcl_DString *) clientData, portion, -1); + Tcl_Encoding utf8 = Tcl_GetEncoding(NULL, "utf-8"); + Tcl_DString ds; + + Tcl_ExternalToUtfDString(utf8, portion, -1, &ds); + Tcl_DStringAppend((Tcl_DString *) clientData, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); + Tcl_DStringFree(&ds); + Tcl_FreeEncoding(utf8); return TCL_OK; } diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 193c3d6..c5f0a50 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -1120,14 +1120,16 @@ Tk_TkwaitObjCmd( static char * WaitVariableProc( ClientData clientData, /* Pointer to integer to set to 1. */ - TCL_UNUSED(Tcl_Interp *), /* Interpreter containing variable. */ - TCL_UNUSED(const char *), /* Name of variable. */ + Tcl_Interp *interp, /* Interpreter containing variable. */ + const char *name1, /* Name of variable. */ TCL_UNUSED(const char *), /* Second part of variable name. */ TCL_UNUSED(int)) /* Information about what happened. */ { int *donePtr = (int *)clientData; *donePtr = 1; + Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + WaitVariableProc, clientData); return NULL; } diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index bae2b89..b8159d6 100644 --- a/macosx/tkMacOSXClipboard.c +++ b/macosx/tkMacOSXClipboard.c @@ -137,13 +137,7 @@ TkSelGetSelection( string = [pb stringForType:type]; } if (string) { - if (target == dispPtr->utf8Atom) { - result = proc(clientData, interp, string.UTF8String); - } else if (target == XA_STRING) { - const char *latin1 = [string - cStringUsingEncoding:NSISOLatin1StringEncoding]; - result = proc(clientData, interp, latin1); - } + result = proc(clientData, interp, string.UTF8String); } } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( |