Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tip-659 Excluding Merge-Ins
This is equivalent to a diff from f08d4a81f2 to 8a35fc9953
2023-06-12
| ||
22:45 | Merge 9.0 check-in: 2a8e051165 user: jan.nijtmans tags: tip-657 | |
2023-05-09
| ||
16:15 | merge-mark Leaf check-in: 8a35fc9953 user: jan.nijtmans tags: tip-659 | |
16:14 | merge-mark check-in: f08d4a81f2 user: jan.nijtmans tags: tip-657 | |
16:11 | Left-over TCL_ENCODING_STRICT, not used any more. Add "-profile tcl8" for testcases which don't work... check-in: c7d09172e8 user: jan.nijtmans tags: trunk, main | |
15:43 | Merge TIP #657 check-in: 48e6cffcc9 user: jan.nijtmans tags: tip-659 | |
15:43 | Merge 9.0 check-in: 5a026323e9 user: jan.nijtmans tags: tip-657 | |
Changes to doc/CrtChannel.3.
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - + | .SH NAME Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelWideSeekProc, Tcl_ChannelTruncateProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_ChannelThreadActionProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels .SH SYNOPSIS .nf \fB#include <tcl.h>\fR .sp Tcl_Channel |
︙ | |||
126 127 128 129 130 131 132 | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | - + - + + + | by any other channel. Can be NULL, in which case the channel is created without a name. If the created channel is assigned to one of the standard channels (\fBstdin\fR, \fBstdout\fR or \fBstderr\fR), the assigned channel name will be the name of the standard channel. .AP void *instanceData in Arbitrary one-word value to be associated with this channel. This value is passed to procedures in \fItypePtr\fR when they are invoked. |
︙ | |||
196 197 198 199 200 201 202 | 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | - + | a \fBTcl_ChannelType\fR structure describing the driver's I/O procedures. The generic layer will then invoke the functions referenced in that structure to perform operations on the channel. .PP \fBTcl_CreateChannel\fR opens a new channel and associates the supplied \fItypePtr\fR and \fIinstanceData\fR with it. The channel is opened in the |
︙ |
Changes to doc/OpenFileChnl.3.
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + | Tcl_Channel \fBTcl_OpenFileChannel\fR(\fIinterp, fileName, mode, permissions\fR) .sp Tcl_Channel \fBTcl_OpenCommandChannel\fR(\fIinterp, argc, argv, flags\fR) .sp Tcl_Channel |
︙ | |||
133 134 135 136 137 138 139 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + - + + + | \fBTCL_STDERR\fR. If \fBTCL_ENFORCE_MODE\fR is not set, then the pipe can redirect stdio handles to override the stdio handles for which \fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set. If it is set, then such redirections cause an error. .AP void *handle in Operating system specific handle for I/O to a file. For Unix this is a file descriptor, for Windows it is a HANDLE. |
︙ |
Changes to doc/encoding.n.
︙ | |||
109 110 111 112 113 114 115 | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | + - + | encoding. .PP The following profiles are currently implemented. .VS "TCL8.7 TIP656" .TP \fBstrict\fR . The default profile, unless the environment variable \fBTCL_PROFILE_DEFAULT\fR |
︙ |
Changes to generic/tclBasic.c.
︙ | |||
879 880 881 882 883 884 885 | 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 | + + + + + - + + + + + + + + + + + + + + + | iPtr->cmdCount = 0; TclInitLiteralTable(&iPtr->literalTable); iPtr->compileEpoch = 1; iPtr->compiledProcPtr = NULL; iPtr->resolverPtr = NULL; iPtr->evalFlags = 0; iPtr->scriptFile = NULL; iPtr->flags = TCL_ENCODING_PROFILE_STRICT; #ifdef _WIN32 wchar_t *defaultProfile = getenv("TCL_PROFILE_DEFAULT"); if (defaultProfile != NULL) { if (!wcscmp(defaultProfile, L"tcl8")) { |
︙ |
Changes to generic/tclCmdAH.c.
︙ | |||
431 432 433 434 435 436 437 | 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | - + | ) { static const char *const options[] = {"-profile", "-failindex", NULL}; enum convertfromOptions { PROFILE, FAILINDEX } optIndex; Tcl_Encoding encoding; Tcl_Obj *dataObj; Tcl_Obj *failVarObj; |
︙ | |||
490 491 492 493 494 495 496 497 498 499 500 501 502 503 | 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 | + + + | if (Tcl_GetEncodingFromObj(interp, objv[objc - 2], &encoding) != TCL_OK) { return TCL_ERROR; } dataObj = objv[objc - 1]; } if (profile == -1) { profile = ENCODING_PROFILE_GET(((Interp *)interp)->flags); } *encPtr = encoding; *dataObjPtr = dataObj; *profilePtr = profile; *failVarPtr = failVarObj; return TCL_OK; } |
︙ |
Changes to generic/tclEncoding.c.
︙ | |||
4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 | 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 | + | const char * TclEncodingProfileIdToName( Tcl_Interp *interp, /* For error messages. May be NULL */ int profileValue) /* Profile #define value */ { size_t i; profileValue &= ENCODING_PROFILE_MASK; for (i = 0; i < sizeof(encodingProfiles) / sizeof(encodingProfiles[0]); ++i) { if (profileValue == encodingProfiles[i].value) { return encodingProfiles[i].name; } } if (interp) { Tcl_SetObjResult( |
︙ |
Changes to generic/tclFCmd.c.
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + | * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclFileSystem.h" #include "tclIO.h" /* * Declarations for local functions defined in this file: */ static int CopyRenameOneFile(Tcl_Interp *interp, Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr, |
︙ | |||
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 | 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 | + + | /* * Create and open the temporary file. */ makeTemporary: chan = TclpOpenTemporaryFile(tempDirObj,tempBaseObj,tempExtObj, nameObj); ENCODING_PROFILE_SET(((Channel *)chan)->state->inputEncodingFlags, ((Interp *)interp)->flags); ENCODING_PROFILE_SET(((Channel *)chan)->state->outputEncodingFlags, ((Interp *)interp)->flags); /* * If we created pieces of template, get rid of them now. */ if (tempDirObj) { TclDecrRefCount(tempDirObj); |
︙ |
Changes to generic/tclIORChan.c.
︙ | |||
678 679 680 681 682 683 684 685 686 687 688 689 690 691 | 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | + + + | chan = Tcl_CreateChannel(&tclRChannelType, TclGetString(rcId), rcPtr, mode); rcPtr->chan = chan; TclChannelPreserve(chan); chanPtr = (Channel *) chan; ENCODING_PROFILE_SET(chanPtr->state->inputEncodingFlags, ((Interp *)interp)->flags); ENCODING_PROFILE_SET(chanPtr->state->outputEncodingFlags, ((Interp *)interp)->flags); if ((methods & NULLABLE_METHODS) != NULLABLE_METHODS) { /* * Some of the nullable methods are not supported. We clone the * channel type, null the associated C functions, and use the result * as the actual channel type. */ |
︙ |
Changes to generic/tclInt.h.
︙ | |||
2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 | 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 | + | * Tcl_Canceled and checking if TCL_ERROR is returned. * This is a one-shot flag that is reset immediately upon * being detected; however, if the TCL_CANCEL_UNWIND flag * is set Tcl_Canceled will continue to report that the * script in progress has been canceled thereby allowing * the evaluation stack for the interp to be fully * unwound. * Bits 24-32 are reserved to store the default encoding profile. * * WARNING: For the sake of some extensions that have made use of former * internal values, do not re-use the flag values 2 (formerly ERR_IN_PROGRESS) * or 8 (formerly ERROR_CODE_SET). */ #define DELETED 1 |
︙ | |||
2864 2865 2866 2867 2868 2869 2870 | 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 | - + | */ #define ENCODING_PROFILE_MASK 0xFF000000 #define ENCODING_PROFILE_GET(flags_) ((flags_) & ENCODING_PROFILE_MASK) #define ENCODING_PROFILE_SET(flags_, profile_) \ do { \ (flags_) &= ~ENCODING_PROFILE_MASK; \ |
︙ |
Changes to generic/tclInterp.c.
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + | * Copyright © 2004 Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclIO.h" /* * A pointer to a string that holds an initialization script that if non-NULL * is evaluated in Tcl_Init() prior to the built-in initialization script * above. This variable can be modified by the function below. */ |
︙ | |||
618 619 620 621 622 623 624 | 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 | - - + + - - + + - - + + | { Tcl_Interp *childInterp; static const char *const options[] = { "alias", "aliases", "bgerror", "cancel", "children", "create", "debug", "delete", "eval", "exists", "expose", "hide", "hidden", "issafe", "invokehidden", |
︙ | |||
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 | 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 | + + + + + + + + + + + + + + + | return TCL_ERROR; } childInterp = GetInterp(interp, objv[2]); if (childInterp == NULL) { return TCL_ERROR; } return ChildRecursionLimit(interp, childInterp, objc - 3, objv + 3); case OPT_PROFILE: if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "?profile?"); return TCL_ERROR; } Interp *iPtr = (Interp *)interp; if (objc == 3) { int newProfile; if (TclEncodingProfileNameToId(interp, Tcl_GetString(objv[2]), &newProfile) != TCL_OK) { return TCL_ERROR; } ENCODING_PROFILE_SET(iPtr->flags, newProfile); } Tcl_AppendResult(interp, TclEncodingProfileIdToName(NULL, iPtr->flags), NULL); return TCL_OK; #ifndef TCL_NO_DEPRECATED case OPT_SLAVES: #endif case OPT_CHILDREN: { InterpInfo *iiPtr; Tcl_Obj *resultPtr; Tcl_HashEntry *hPtr; |
︙ |
Changes to tests/cmdAH.test.
︙ | |||
303 304 305 306 307 308 309 | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | - + | testconvert $id.$enc.$profile "list \[encoding $converter -profile $profile -failindex idx $enc [list $data]\] \[set idx\]" [list $result $failidx] if {[set enc2 [endianUtf $enc]] ne ""} { # If utf{16,32}-{le,be}, also do utf{16,32} testconvert $id.$enc2.$profile "list \[encoding $converter -profile $profile -failindex idx $enc2 [list $data]\] \[set idx]" [list $result $failidx] } # If this is the default profile, generate a test without specifying profile |
︙ |
Changes to tests/encoding.test.
︙ | |||
818 819 820 821 822 823 824 | 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 | - + | test encoding-24.15.tcl8 {Parse invalid utf-8, -profile tcl8} -body { encoding convertfrom -profile tcl8 utf-8 "Z\xE0\x80" } -result Z\xE0\u20AC test encoding-24.16 {Parse valid or invalid utf-8} -constraints testbytestring -body { encoding convertto utf-8 [testbytestring "Z\u4343\x80"] } -returnCodes 1 -result {expected byte sequence but character 1 was '䍃' (U+004343)} test encoding-24.17 {Parse valid or invalid utf-8} -constraints testbytestring -body { |
︙ |
Changes to tests/encodingVectors.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + | # This file contains test vectors for verifying various encodings. They are # stored in a common file so that they can be sourced into the various test # modules that are dependent on encodings. This file contains statically defined # test vectors. In addition, it sources the ICU-generated test vectors from # icuUcmTests.tcl. # # Note that sourcing the file will reinitialize any existing encoding test # vectors. # # List of defined encoding profiles set encProfiles {tcl8 strict replace} |
︙ |
Changes to tests/interp.test.
︙ | |||
28 29 30 31 32 33 34 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - + - + - + - + | # Part 0: Check out options for interp command test interp-1.1 {options for interp command} -returnCodes error -body { interp } -result {wrong # args: should be "interp cmd ?arg ...?"} test interp-1.2 {options for interp command} -returnCodes error -body { interp frobox |
︙ |