Tcl Source Code

Check-in [522899ab24]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix for 370b1ff03e. Not complete/correct yet, since this backouts the fix for [4dbfa46caa]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-370b1ff03e
Files: files | file ages | folders
SHA3-256: 522899ab24cba7bbaf673e8af466ded021ab7efefd2debd945260226331f4dbf
User & Date: jan.nijtmans 2023-01-08 22:47:45
Context
2023-01-16
13:10
New flag TCL_ENCODING_HACK_FLAG to control the behaviour. (This is NOT the way to do it, but it's on... check-in: b8201a96c4 user: jan.nijtmans tags: bug-370b1ff03e
2023-01-08
22:47
Fix for 370b1ff03e. Not complete/correct yet,... check-in: 522899ab24 user: jan.nijtmans tags: bug-370b1ff03e
2023-01-06
17:33
Merge 8.6 check-in: 332f4f9655 user: jan.nijtmans tags: core-8-branch
2022-03-21
09:57
Fix [4dbfa46caa]: TIP #601 bug: handling of '-buffersize' check-in: dd396e24b7 user: jan.nijtmans tags: core-8-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclEncoding.c.

2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
	     * Always check before using TclUtfToUCS4. Not doing can so
	     * cause it run beyond the end of the buffer! If we happen such an
	     * incomplete char its bytes are made to represent themselves
	     * unless the user has explicitly asked to be told.
	     */

	    if (flags & TCL_ENCODING_MODIFIED) {
		if ((STOPONERROR) && (flags & TCL_ENCODING_CHAR_LIMIT)) {
		    result = TCL_CONVERT_MULTIBYTE;
		    break;
		}
	    if (((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT)) {
		result = TCL_CONVERT_SYNTAX;
		break;
	    }







|







2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
	     * Always check before using TclUtfToUCS4. Not doing can so
	     * cause it run beyond the end of the buffer! If we happen such an
	     * incomplete char its bytes are made to represent themselves
	     * unless the user has explicitly asked to be told.
	     */

	    if (flags & TCL_ENCODING_MODIFIED) {
		if (STOPONERROR) {
		    result = TCL_CONVERT_MULTIBYTE;
		    break;
		}
	    if (((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT)) {
		result = TCL_CONVERT_SYNTAX;
		break;
	    }
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
	if (!len) {
	    word = 0;
	} else
#endif
	    word = fromUnicode[(ch >> 8)][ch & 0xFF];

	if ((word == 0) && (ch != 0)) {
	    if ((STOPONERROR) && (flags & TCL_ENCODING_CHAR_LIMIT)) {
		result = TCL_CONVERT_UNKNOWN;
		break;
	    }
	    word = dataPtr->fallback;
	}
	if (prefixBytes[(word >> 8)] != 0) {
	    if (dst + 1 > dstEnd) {







|







3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
	if (!len) {
	    word = 0;
	} else
#endif
	    word = fromUnicode[(ch >> 8)][ch & 0xFF];

	if ((word == 0) && (ch != 0)) {
	    if (STOPONERROR) {
		result = TCL_CONVERT_UNKNOWN;
		break;
	    }
	    word = dataPtr->fallback;
	}
	if (prefixBytes[(word >> 8)] != 0) {
	    if (dst + 1 > dstEnd) {