From 74b5e64e6a54ac5f6c52b2c374438d0c30365dff Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Oct 2019 09:16:03 +0000 Subject: Fix a few typo's --- ChangeLog.2002 | 2 +- doc/keysyms.n | 2 +- macosx/tkMacOSXFont.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog.2002 b/ChangeLog.2002 index b523e7d..b27b92b 100644 --- a/ChangeLog.2002 +++ b/ChangeLog.2002 @@ -5218,7 +5218,7 @@ 2000-05-31 Eric Melski * library/bgerror.tcl: Improved bgerror based on work by Donal - K. Fellows; no longer dependant on tk_dialog; features a + K. Fellows; no longer dependent on tk_dialog; features a Windows-esque "Details" button, and a customizable extra function button that allows the user to (for example) save the stack trace to a file. diff --git a/doc/keysyms.n b/doc/keysyms.n index 1e14f10..d5822a6 100644 --- a/doc/keysyms.n +++ b/doc/keysyms.n @@ -18,7 +18,7 @@ keysyms that will be recognized by Tk. Note that not all keysyms will be valid on all platforms, and some keysyms are also available on platforms that have a different native name for that key. For example, on Unix systems, the presence -of a particular keysym is dependant on the configuration of the +of a particular keysym is dependent on the configuration of the keyboard modifier map. This list shows keysyms along with their decimal and hexadecimal values. .PP diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index fb71e85..e68b09f 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -343,7 +343,7 @@ CreateNamedSystemFont( * * This procedure is called when an application is created. It * initializes all the structures that are used by the - * platform-dependant code on a per application basis. + * platform-dependent code on a per application basis. * Note that this is called before TkpInit() ! * * Results: -- cgit v0.12 From be42ed39b45938000bdf6dc5b4f2c7cab5624927 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Oct 2019 09:19:35 +0000 Subject: One step more in fully fixing [a179564826]: Tk 8.6: prevent issues when encountering non-BMP Unicode characters. Now that Tcl 8.6 doesn't handle 4-byte UTF-8 characters as invalid anymore, we don't need the trick in Tk any more to spit out two surrogates: Tcl already handles that correctly. --- generic/tkUtil.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 1942975..8e3e2ee 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -1244,8 +1244,8 @@ TkUtfToUniChar( * * TkUniCharToUtf -- * - * Almost the same as Tcl_UniCharToUtf but producing surrogates if - * TCL_UTF_MAX==3. So, up to 6 bytes might be produced. + * Almost the same as Tcl_UniCharToUtf but producing 4-byte UTF-8 + * sequences even when TCL_UTF_MAX==3. So, up to 4 bytes might be produced. * * Results: * *buf is filled with the UTF-8 string, and the return value is the @@ -1262,10 +1262,12 @@ int TkUniCharToUtf(int ch, char *buf) int size = Tcl_UniCharToUtf(ch, buf); if ((((unsigned)(ch - 0x10000) <= 0xFFFFF)) && (size < 4)) { /* Hey, this is wrong, we must be running TCL_UTF_MAX==3 - * The best thing we can do is spit out 2 surrogates */ - ch -= 0x10000; - size = Tcl_UniCharToUtf(((ch >> 10) | 0xd800), buf); - size += Tcl_UniCharToUtf(((ch & 0x3ff) | 0xdc00), buf+size); + * The best thing we can do is spit out a 4-byte UTF-8 character */ + buf[3] = (char) ((ch | 0x80) & 0xBF); + buf[2] = (char) (((ch >> 6) | 0x80) & 0xBF); + buf[1] = (char) (((ch >> 12) | 0x80) & 0xBF); + buf[0] = (char) ((ch >> 18) | 0xF0); + size = 4; } return size; } -- cgit v0.12