Artifacts Associated With Ticket 084ab982fe
Ticket change [6821bbf933] (rid 207555) by jan.nijtmans on 2022-11-29 11:51:32:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Request, initiated by Rolf Ade. <pre> Look at this: % info patchlevel 9.0a4 % encoding system utf-8 % puts \uffff error writing "stdout": illegal byte sequence </pre> Although this was on purpose, TIP #346 could be used to reduce the surprise here: When -strictencoding is specified, disallow non-characters, otherwise allow them. The same will be done on 'encoding convertto utf-8' as well. (since the -strict handling is built-in in the utf-8 encoder/decoder)
- is_private initialized to: "0"
- login: "jan.nijtmans"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "jan.nijtmans"
- subsystem initialized to: "26. Channel Transforms"
- title initialized to: "Use -strict to disable noncharacters"
- type initialized to: "RFE"
Ticket change [5d1cea1a40] (rid 207556) by jan.nijtmans on 2022-11-29 11:53:59:
- assignee changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"
Ticket change [30a22094e9] (rid 207571) by oehhar on 2022-11-29 17:22:09:
- icomment:
Great implementation with test-cases in light speed by Jan: [084ab982fe] Thank you, I appreciate, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [69ee650a81] (rid 207646) by jan.nijtmans on 2022-12-01 07:46:22:
- closedate changed to: "2459914.82387677"
- closer changed to: "jan.nijtmans"
- icomment: "Fixed [9619dddce629db7b|here]"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [6ac65cb756] (rid 207716) by pointsman on 2022-12-02 12:14:29:
- closedate changed to: "2459916.01006194"
- closer changed to: "pointsman"
- icomment:
One thing is probably not made clear enough by me (probably because I'm in fact try to not sound "a little sharp on the vocal level", although sometimes obviously failing). Why do we have the fconfigure -strict mode at all? The current default is "strict" in the sense of eg. python, that means: raise error on surrogate. Addionally there is -nocomplain, passing all code-points through. Both modes are fine and understandable to have. Additionally we the mode -strict 1 (which is a bit a confusing name) which raises error on surrogate and noncharacter. This surely is a "feature" in the sense it has a defined behaviour. But what is the use case? Who needs this? Is this not an more obscure than just minor feature? Especially since there is also the [string is unicode] feature. An IMHO gross misnomer, did I said this already? If someone wants the behaviour this fconfigure -strict 1 feature provides one can always do if {[string is unicode $mystring]} { puts $chan $mystring } else { # Handle case of mystring with noncharacter } instead of if {[catch {puts $chan $mystring}]} { # Handle case of mystring with noncharacter } - login: "pointsman"
- mimetype: "text/plain"
Ticket change [82f589be52] (rid 207717) by jan.nijtmans on 2022-12-02 12:42:39:
- closedate changed to: "2459916.02962865"
- closer changed to: "jan.nijtmans"
- icomment:
> Additionally we the mode -strict 1 (which is a bit a confusing name) which raises error on surrogate and noncharacter. The "-strict 1" mode does more than only raising errors on noncharacters. The default utf-8 decoder tries to correct obvious error, in 'strict' mode it doesn't do that any more. e.g.: <pre> $ tclsh9.0 % encoding convertfrom utf-8 \xA1 ยก % encoding convertfrom -strict utf-8 \xA1 unexpected byte sequence starting at index 0: '\xA1' % </pre> '-strict 1' mode is a flag, whose behavior is implemented by every encoder/decoder separately.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [9f94911429] (rid 207856) by jan.nijtmans on 2022-12-16 09:41:45:
- closedate changed to: "2459929.90400097"
- foundin changed to: "8.7"
- icomment:
Follow-up [b7da2f7465c794aa|here]. If we change the behavior of -strict for utf-8, we should do the corresponding change on utf-16 and utf-32 too.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [77874b2e46] (rid 207990) by pooryorick on 2022-12-26 20:31:11:
- closer changed to: "nobody"
- icomment:
Overloading <code>-strict</code> for this purpose is incorrect, as <code>-strict</code> should be dedicated to how to handle invalid data in an encoding, not on choosing which data to consider invalid. This is a separate concern that should be handled by separate options. By default, an encoder/decoder should conform to the specification, and options can be provided to direct the encoder/decoder to deviate in some way. In this case, a suitable option might be <code>-onlychars 1</code>, with the default being <code>-onlychars 0</code> to conform to the specification. There could be additional options such as <code>-surrogates 1</code> (default is <code>-surrogates 0</code>) and <code>-nonchars 0</code> (default is <code>-nonchars 1</code>). This is more complicated, but oversimplification can be a bad thing. The Unicode specification entails a certain amount of complexity, and there is no way around that. In the case of Unicode, the proper target for Tcl is fidelity.
- login: "pooryorick"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Accepted"
- status changed to: "Open"
Ticket change [7d223a8da8] (rid 208063) by jan.nijtmans on 2022-12-29 23:42:32:
- closedate changed to: "2459943.48787731"
- closer changed to: "jan.nijtmans"
- icomment:
pooryorick's last comment is out-of-date, since the behavior of -strict is already modified to be more conform 'strict'-ness as described by the Unicode consortium. So, closing (again)
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [14e0e130d3] (rid 208069) by pooryorick on 2022-12-30 20:41:45:
- closedate changed to: "2459944.36233572"
- closer changed to: "pooryorick"
- icomment:
See issue report [17a1cb8d6e2a51bd] for further details.
- login: "pooryorick"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Rejected"