Artifacts Associated With Ticket d19fe0a5b
Ticket change [3ecf8689e1] (rid 208949) by jan.nijtmans on 2023-02-21 08:36:45:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Example: <pre> % encoding convertfrom utf-16le \x41\x00\x41 A </pre> In Tcl 8.7, we see what's happening when using -strict <pre> % encoding convertfrom -strict utf-16le \x41\x00\x00 unexpected byte sequence starting at index 2: '\x0' </pre> But in Tcl 8.6 we don't have -strict, and the byte is silently ignored. That's not good. Many encodings either output the remaining bytes as-is or the replacement character \xFFFD. For UTF-16/32 outputting the remaining bytes (which easily could be \x00) doesn't make much sense. So most logical would be to output the replacement character in this case (just one).
- foundin initialized to: "8.6"
- is_private initialized to: "0"
- login: "jan.nijtmans"
- priority initialized to: "5 Medium"
- private_contact initialized to: "0c50e5320704d174412e57b873d8932de15303e0"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "jan.nijtmans"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to:
Handling incomplete byte sequences for utf-16/utf-32
- type initialized to: "Bug"
Ticket change [798c1f2614] (rid 208951) by apnadkarni on 2023-02-21 15:59:26:
- icomment:
I had noticed that in my test scripts and adjusted tests accordingly! The premise being that 8.6 was the "gold standard" for 8.x and -profile tcl8 would match that exactly. /Ashok
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [c4f3dda2af] (rid 208960) by jan.nijtmans on 2023-02-21 16:22:37:
- assignee changed to: "jan.nijtmans"
- icomment:
I known that 8.6 is the "gold standard", but in this case the 8.6 behavior is not reasonable at all. We could discuss whether \xFFFD or '?' should be output. So, when there is doubt, keep it as-is. I have no doubt that \xFFFD is the 'right' thing to do here. In this case, silently removing bytes is not described anywhere in the documentation, and no other encoder/decoder does that. So it's 100% defendable that this is a bug in 8.6. Bugs can be fixed, always. Thanks for noticing this!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [18c78c5ffc] (rid 208977) by jan.nijtmans on 2023-02-21 17:52:00:
- icomment:
Proposed fix [be99e0b905a6dd7d|here]. Of course, Tcl 8.6 doesn't have utf-16* and utf-32*, it only has "unicode"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [679f46fa6a] (rid 209078) by jan.nijtmans on 2023-02-23 11:17:16:
- closedate changed to: "2459998.97033498"
- closer changed to: "jan.nijtmans"
- icomment:
Follow-up [548b08e28bde6ab2|here] When this fix was merged forward, it turned out that Tcl 8.7 only produces TCL_CONVERT_SYNTAX in -strict mode here. Which doesn't exist in 8.6. Therefore - in Tcl 8.6 - we should always produce \xFFFD in this case for maximum consistancy between Tcl versions. So, in Tcl 8.6 now: <pre> $ tclsh8.6 % encoding convertfrom unicode \x41\x41\x41 䅁� </pre>
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"