diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-18 22:34:14 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-18 22:34:14 (GMT) |
commit | 59ad43ee2cc3bf96c957151d431acd9a423e604d (patch) | |
tree | 2fccb9a139931d42427bd38662ef8b98e6b4787d | |
parent | 1dd829fb01e13e3c74113061a59bea80ad2b7860 (diff) | |
parent | 04ea3b8bff2991e54cc2469b372927735c9d7a83 (diff) | |
download | tcl-59ad43ee2cc3bf96c957151d431acd9a423e604d.zip tcl-59ad43ee2cc3bf96c957151d431acd9a423e604d.tar.gz tcl-59ad43ee2cc3bf96c957151d431acd9a423e604d.tar.bz2 |
Merge 8.7
-rw-r--r-- | doc/Utf.3 | 7 | ||||
-rw-r--r-- | generic/tclScan.c | 2 | ||||
-rw-r--r-- | generic/tclUtf.c | 2 |
3 files changed, 6 insertions, 5 deletions
@@ -130,9 +130,10 @@ represent one Unicode character in the UTF-8 representation. \fBTcl_UniCharToUtf\fR stores the character \fIch\fR as a UTF-8 string in starting at \fIbuf\fR. The return value is the number of bytes stored in \fIbuf\fR. If ch is a high surrogate (range U+D800 - U+DBFF), then -the return value will be 0 and nothing will be stored. If you still -want to produce UTF-8 output for it (even though knowing it's an illegal -code-point on its own), just call \fBTcl_UniCharToUtf\fR again using ch = -1. +the return value will be 1 and a single byte in the range 0xF0 - 0xF4 +will be stored. If you still want to produce UTF-8 output for it (even +though knowing it's an illegal code-point on its own), just call +\fBTcl_UniCharToUtf\fR again specifying ch = -1. .PP \fBTcl_UtfToUniChar\fR reads one UTF-8 character starting at \fIsrc\fR and stores it as a Tcl_UniChar in \fI*chPtr\fR. The return value is the diff --git a/generic/tclScan.c b/generic/tclScan.c index 0db1dd3..95006ca 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -261,7 +261,7 @@ ValidateFormat( Tcl_UniChar ch = 0; int objIndex, xpgSize, nspace = numVars; int *nassign = TclStackAlloc(interp, nspace * sizeof(int)); - char buf[TCL_UTF_MAX+1] = ""; + char buf[TCL_UTF_MAX + 1] = ""; Tcl_Obj *errorMsg; /* Place to build an error messages. Note that * these are messy operations because we do * not want to use the formatting engine; diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 59116c4..e28e88e 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -447,7 +447,7 @@ Tcl_UtfToUniChar( #else *chPtr = (((byte & 0x07) << 18) | ((src[1] & 0x3F) << 12) | ((src[2] & 0x3F) << 6) | (src[3] & 0x3F)); - if ((*chPtr - 0x10000) <= 0xFFFFF) { + if ((unsigned)(*chPtr - 0x10000) <= 0xFFFFF) { return 4; } #endif |