Artifacts Associated With Ticket 53cad613d8a4de16
Ticket change [c0c0e30201] (rid 163990) by fvogel on 2018-06-16 06:05:38:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Since TIP 389 was committed in core-8-branch, that is since [e109760b1c], two tests from the Tk test suite started failing as follows: <verbatim> ==== font-4.12 font command: actual FAILED ==== Contents of test case: font actual {-family times} -- \ud800 ---- Test generated error; Return code was: 1 ---- Return code should have been one of: 0 2 ---- errorInfo: expected a single character but got "" while executing "font actual {-family times} -- \ud800" ("uplevel" body line 2) invoked from within "uplevel 1 $script" ---- errorCode: TK VALUE FONT_SAMPLE ==== font-4.12 FAILED ==== font-4.15 font command: actual FAILED ==== Contents of test case: font actual {-family times} -- \udc00\ud800 ---- Test completed normally; Return code was: 0 ---- Return code should have been one of: 1 ==== font-4.15 FAILED </verbatim> Both behaviors can be reproduced easily outside of the Tk test suite: <verbatim> % package require Tk 8.7a2 % font actual {-family times} -- \ud800 ; # font-4.12 expected a single character but got "" % font actual {-family times} -- \udc00\ud800 ; # font-4.15 -family times -size 12 -weight normal -slant roman -underline 0 -overstrike 0 % </verbatim> Note that in contrast font-4.13 and font-4.14 do not fail, despite being very similar: <verbatim> % font actual {-family times} -- \udc00 ; # font-4.13 -family times -size 12 -weight normal -slant roman -underline 0 -overstrike 0 % font actual {-family times} -family -- \ud800\udc00 ; # font-4.14 times </verbatim> I'm unsure whether implementation of TIP 389 has a bug, or if Tk should be changed to match TIP 389, but I'm inclined to suspect the former because the TIP states: <pre>As long as no Surrogates or characters >= U+010000 are used, all functions behave exactly the same as before.</pre> - foundin initialized to: "core-8-branch"
- is_private initialized to: "0"
- login: "fvogel"
- priority initialized to: "5 Medium"
- private_contact initialized to: "a013af67114eccc19ad12b04f14923acea9e96b7"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "fvogel"
- subsystem initialized to: "44. UTF-8 Strings"
- title initialized to: "TIP 389 implementation makes Tk tests fail"
- type initialized to: "Bug"
Ticket change [1bcd062e32] (rid 163991) by fvogel on 2018-06-16 06:05:50:
- assignee changed to: "jan.nijtmans"
- login: "fvogel"
- mimetype: "text/plain"
Ticket change [e69e7096f8] (rid 163992) by fvogel on 2018-06-16 06:08:12:
- login: "fvogel"
- mimetype: "text/plain"
- title changed to:
TIP 389 implementation makes Tk tests font-4.12 and font-4.15 fail
Ticket change [5d39e1f479] (rid 164010) by jan.nijtmans on 2018-06-16 13:31:54:
- icomment:
Thanks, François, for noticing this! I'll have a look. Actually, Tk was already adapted here to match TIP-389, but after that some changes in surrogate handling were added to the Tcl implementation (to make it more robust). The \ud800 character is a high surrogate, which is not expected in isolation, that's what this test is testing for. I'm suspecting the compatibility function TkUtfToUniChar(), but I'll have a further look. It's not really a problem, since such a surrogate in isolation is invalid anyway. But at least Tk should react sensibly to it. Thanks!
- login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [42e70e58a4] (rid 164042) by jan.nijtmans on 2018-06-17 16:16:37:
- closedate changed to: "2458287.17821156"
- closer changed to: "jan.nijtmans"
- icomment:
The actual bug turned out to be in the function TclParseBackslash(). Fixed now in core-8-6-branch (for the benefit of androwish), core-8-branch and trunk. Thanks for your patience .... ;-)
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [577b1bfd85] (rid 164049) by fvogel on 2018-06-17 20:48:51:
- closedate changed to: "2458287.36725949"
- closer changed to: "fvogel"
- icomment:
Confirmed it works for me as well. Many thanks, that was quick fixing!
- login: "fvogel"
- mimetype: "text/plain"
Ticket change [fcc9e74792] (rid 164058) by jan.nijtmans on 2018-06-18 10:58:20:
- closedate changed to: "2458287.95718297"
- closer changed to: "jan.nijtmans"
- icomment:
Still, this bug is not 100% fixed yet, there are multiple ways for generating a UTF-8 representation, backslash handling is not the only one: Demonstration: % string length [format %c 0xd800] 0 The correct answer should be 1. Stay tuned .... fix in progress.
- login: "jan.nijtmans"
- mimetype: "text/plain"