summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tcl.decls2
-rw-r--r--generic/tcl.h4
-rw-r--r--generic/tclEncoding.c23
-rw-r--r--tests/icuUcmTests.tcl2
-rw-r--r--tests/ioTrans.test3
5 files changed, 20 insertions, 14 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index f2ba187..51d9ee5 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2447,7 +2447,7 @@ declare 658 {
int Tcl_ExternalToUtfDStringEx(Tcl_Interp *interp, Tcl_Encoding encoding,
const char *src, Tcl_Size srcLen, int flags, Tcl_DString *dsPtr,
Tcl_Size *errorLocationPtr)
-}
+}
declare 659 {
int Tcl_UtfToExternalDStringEx(Tcl_Interp *interp, Tcl_Encoding encoding,
const char *src, Tcl_Size srcLen, int flags, Tcl_DString *dsPtr,
diff --git a/generic/tcl.h b/generic/tcl.h
index 705ec3a..e66607b 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2126,7 +2126,7 @@ typedef struct Tcl_EncodingType {
* TCL_ENCODING_PROFILE_* - Mutually exclusive encoding profile ids. Note
* these are bit masks.
*
- * NOTE: THESE BIT DEFINITIONS SHOULD NOT OVERLAP WITH INTERNAL USE BITS
+ * NOTE: THESE BIT DEFINITIONS SHOULD NOT OVERLAP WITH INTERNAL USE BITS
* DEFINED IN tclEncoding.c (ENCODING_INPUT et al). Be cognizant of this
* when adding bits.
*/
@@ -2435,7 +2435,7 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
# else
# define Tcl_InitStubs(interp, version, exact) \
(Tcl_InitStubs)(interp, TCL_PATCH_LEVEL, \
- 1|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
+ (exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
TCL_STUB_MAGIC)
# endif
#else
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 1e6f9c3..0478519 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -549,11 +549,11 @@ FillEncodingFileMap(void)
*---------------------------------------------------------------------------
*/
-/*
- * NOTE: THESE BIT DEFINITIONS SHOULD NOT OVERLAP WITH INTERNAL USE BITS
+/*
+ * NOTE: THESE BIT DEFINITIONS SHOULD NOT OVERLAP WITH INTERNAL USE BITS
* DEFINED IN tcl.h (TCL_ENCODING_* et al). Be cognizant of this
* when adding bits. TODO - should really be defined in a single file.
- *
+ *
* To prevent conflicting bits, only define bits within 0xff00 mask here.
*/
#define TCL_ENCODING_LE 0x100 /* Used to distinguish LE/BE variants */
@@ -2808,16 +2808,19 @@ Utf32ToUtfProc(
break;
} else if (PROFILE_REPLACE(flags) && SURROGATE(ch)) {
ch = UNICODE_REPLACE_CHAR;
- }
+ }
/*
* Special case for 1-byte utf chars for speed. Make sure we work with
* unsigned short-size data.
*/
- if ((ch > 0) && (ch < 0x80)) {
+ if ((unsigned)ch - 1 < 0x7F) {
*dst++ = (ch & 0xFF);
} else {
+ if (((prev & ~0x3FF) != 0xD800) && ((ch & ~0x3FF) == 0xDC00)) {
+ *dst = 0; /* In case of lower surrogate, don't try to combine */
+ }
dst += Tcl_UniCharToUtf(ch, dst);
}
src += 4;
@@ -3043,7 +3046,7 @@ Utf16ToUtfProc(
}
if (((prev & ~0x3FF) == 0xD800) && ((ch & ~0x3FF) != 0xDC00)) {
if (PROFILE_STRICT(flags)) {
- result = TCL_CONVERT_UNKNOWN;
+ result = TCL_CONVERT_SYNTAX;
src -= 2; /* Go back to beginning of high surrogate */
dst--; /* Also undo writing a single byte too much */
numChars--;
@@ -3064,7 +3067,7 @@ Utf16ToUtfProc(
dst += Tcl_UniCharToUtf(ch, dst);
} else if (((ch & ~0x3FF) == 0xDC00) && PROFILE_STRICT(flags)) {
/* Lo surrogate not preceded by Hi surrogate */
- result = TCL_CONVERT_UNKNOWN;
+ result = TCL_CONVERT_SYNTAX;
break;
} else {
*dst = 0; /* In case of lower surrogate, don't try to combine */
@@ -3075,7 +3078,7 @@ Utf16ToUtfProc(
if ((ch & ~0x3FF) == 0xD800) {
if (PROFILE_STRICT(flags)) {
- result = TCL_CONVERT_UNKNOWN;
+ result = TCL_CONVERT_SYNTAX;
src -= 2;
dst--;
numChars--;
@@ -4468,7 +4471,7 @@ TclEncodingProfileNameToId(
if (interp) {
Tcl_Obj *errorObj;
/* This code assumes at least two profiles :-) */
- errorObj =
+ errorObj =
Tcl_ObjPrintf("bad profile name \"%s\": must be",
profileName);
for (i = 0; i < (numProfiles - 1); ++i) {
@@ -4535,7 +4538,7 @@ TclEncodingProfileIdToName(
* is mapped to the TCL_ENCODING_PROFILE_STRICT overwriting any profile
* specified.
*
- * If no profile or an invalid profile is specified, it is set to
+ * If no profile or an invalid profile is specified, it is set to
* the default.
*
* Results:
diff --git a/tests/icuUcmTests.tcl b/tests/icuUcmTests.tcl
index 0c4071f..3b70748 100644
--- a/tests/icuUcmTests.tcl
+++ b/tests/icuUcmTests.tcl
@@ -45,7 +45,7 @@ if {[info commands printable] eq ""} {
return $print
}
}
-
+
#
# cp1250 (generated from glibc-CP1250-2.1.2)
diff --git a/tests/ioTrans.test b/tests/ioTrans.test
index 9639576..9f6542c 100644
--- a/tests/ioTrans.test
+++ b/tests/ioTrans.test
@@ -643,6 +643,9 @@ namespace eval reflector {
proc finalize {_ chan} {
+ foreach id [after info] {
+ after cancel $id
+ }
namespace delete $_
}