summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-15 09:20:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-15 09:20:17 (GMT)
commit178635dd58322a9e3dd219f55b81023fac724c4f (patch)
tree4931999e3dd2fbea60fd195fd95654302c5183ab
parente3b515e0b616ab42cff45b183f8b41cd2b8ba7cc (diff)
parentbe42ed39b45938000bdf6dc5b4f2c7cab5624927 (diff)
downloadtk-178635dd58322a9e3dd219f55b81023fac724c4f.zip
tk-178635dd58322a9e3dd219f55b81023fac724c4f.tar.gz
tk-178635dd58322a9e3dd219f55b81023fac724c4f.tar.bz2
Merge 8.6
-rw-r--r--ChangeLog.20022
-rw-r--r--doc/keysyms.n2
-rw-r--r--generic/tkUtil.c14
-rw-r--r--macosx/tkMacOSXFont.c2
4 files changed, 11 insertions, 9 deletions
diff --git a/ChangeLog.2002 b/ChangeLog.2002
index a1ba923..5bfc4f7 100644
--- a/ChangeLog.2002
+++ b/ChangeLog.2002
@@ -5218,7 +5218,7 @@
2000-05-31 Eric Melski <ericm@scriptics.com>
* 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 0ad0324..e107219 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/generic/tkUtil.c b/generic/tkUtil.c
index 4844bc2..e014a41 100644
--- a/generic/tkUtil.c
+++ b/generic/tkUtil.c
@@ -1243,8 +1243,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
@@ -1261,10 +1261,12 @@ size_t TkUniCharToUtf(int ch, char *buf)
size_t 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;
}
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index ee2ddc4..7659163 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: