Check-in [f867f44c9c]
Not logged in

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

Overview
Comment:Set the encoding profile to strict in Tcl_FSEvalFileEx(). This is independent of TIP 657: A script to be evaluated must be properly encoded in any case.
Timelines: family | ancestors | descendants | both | pyk-whatever
Files: files | file ages | folders
SHA3-256: f867f44c9cb406b050545a9c6320f977aacc1980d2b9f1a2066f9b98554f6b5c
User & Date: pooryorick 2023-04-23 11:39:10.155
References
2023-04-23
11:48
merge trunk [f867f44c9c]. check-in: be70a97e6d user: pooryorick tags: trunk-encodingdefaultstrict
Context
2023-04-23
18:25
That fixes the examples given in [0306a5563c]. Needs more consideration before claim success. Closed-Leaf check-in: 67231d38a8 user: pointsman tags: pyk-whatever, bug-0306a5563c
11:48
merge trunk [f867f44c9c]. check-in: be70a97e6d user: pooryorick tags: trunk-encodingdefaultstrict
11:39
Set the encoding profile to strict in Tcl_FSEvalFileEx(). This is independent of TIP 657: A scrip... Closed-Leaf check-in: f867f44c9c user: pooryorick tags: pyk-whatever
11:28
Add bytearray checking to TclCheckEmptyString(), and then use TclCheckEmptyString() in Tcl_AppendOb... check-in: a61fef8429 user: pooryorick tags: pyk-whatever
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tclIOUtil.c.
1729
1730
1731
1732
1733
1734
1735





1736
1737
1738
1739
1740
1741
1742
    if (encodingName == NULL) {
	encodingName = "utf-8";
    }
    if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
	    != TCL_OK) {
	Tcl_CloseEx(interp,chan,0);
	return result;





    }

    TclNewObj(objPtr);
    Tcl_IncrRefCount(objPtr);

    /*
     * Read first character of stream to check for utf-8 BOM







>
>
>
>
>







1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
    if (encodingName == NULL) {
	encodingName = "utf-8";
    }
    if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
	    != TCL_OK) {
	Tcl_CloseEx(interp,chan,0);
	return result;
    }
    if (Tcl_SetChannelOption(interp, chan, "-profile", "strict")
	    != TCL_OK) {
	Tcl_CloseEx(interp,chan,0);
	return result;
    }

    TclNewObj(objPtr);
    Tcl_IncrRefCount(objPtr);

    /*
     * Read first character of stream to check for utf-8 BOM