Artifacts Associated With Ticket 11ae2be95d
Ticket change [7197819b58] (rid 140932) by anonymous on 2014-12-11 21:38:40:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% string range a\U10000b 0 0 a % string range a\U10000b 1 1 Segmentation fault % string range a\U10000b 2 2 Segmentation fault
- foundin initialized to: "5e0b59a946"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "25aa27f9a8b2380e071f3a1542c37690535afa6f"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "44. UTF-8 Strings"
- title initialized to:
tip-389-impl branch: string range segfaults with code points greater than U+FFFF
- type initialized to: "Bug"
Ticket change [ebdac6e309] (rid 140934) by jan.nijtmans on 2014-12-12 15:10:19:
- assignee changed to: "jan.nijtmans"
- icomment: "Dup of [3408718]"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Duplicate"
Ticket change [82653b05b8] (rid 140935) by jan.nijtmans on 2014-12-12 15:10:43:
- closedate changed to: "2457004.13244603"
- closer changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"
- status changed to: "Closed"
Ticket change [397da76cb2] (rid 160134) by dgp on 2018-01-10 15:03:16:
- closer changed to: "nobody"
- icomment:
Re-opening. The segfaults are indeed gone but now on the tip-389 branch: % string range a\U10000b 0 0 a % string range a\U10000b 1 1 % string range a\U10000b 2 2 st Especially for the last command, I'd expect the result "b" I'm far from confident the middle command is doing the right thing too.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Remind"
- status changed to: "Open"
Ticket change [927bf31db6] (rid 160135) by dgp on 2018-01-10 15:04:09:
- login: "dgp"
- mimetype: "text/plain"
- title changed to:
tip-389 branch: string range errors with code points greater than U+FFFF
Ticket change [4346da0f77] (rid 160137) by sebres on 2018-01-10 15:18:44:
- icomment:
> @dgp Especially for the last command, I'd expect the result "b" Just to be sure: is it a valid escape-sequence at all? I mean, do you not need 32-bit hex value there? For example doing this in python will cause following error: >>> 'a\U10000b' SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 1-8: truncated \UXXXXXXXX escape
- login: "sebres"
- mimetype: "text/plain"
- icomment:
Ticket change [3d2e55ac65] (rid 160138) by dgp on 2018-01-10 15:24:55:
- icomment:
To remove the abiguity about where \UHHHHHHHHH parsing ends.... % string index a\U10ffff! 2 pßÿ¿ % string index a-! 2 !
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [b66ce02af5] (rid 160139) by jan.nijtmans on 2018-01-10 15:45:28:
- icomment:
I'll have a loot at "string range" and "string index". In the current implementation, a character > \U0ffff occupies 2 locations in the string (= actually 'character array'). So we must implement a precaution that we can never point in the middle of a upper/lower surrogate pair. That's what goes wrong here. The best thing to do is - I think - to round up any index that points in the middle of a surrogate pair. So, what I would expect: % string range a\U10000b 0 0 a % string range a\U10000b 1 1 \U10000 (however that would be displayed ...) % string range a\U10000b 2 2 % string range a\U10000b 3 3 b Indeed, there's still something to be done here. Thanks!
- login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [de4882c638] (rid 160140) by dgp on 2018-01-10 15:54:11:
- icomment:
Aarrggh. used the wrong number of 0's in an earlier comment. lets try again.... % string range a\U100000b 0 0 a % string range a\U100000b 1 1 % string range a\U100000b 2 2 st % string range a\U100000b 3 3 b Ok, that's a somewhat different kettle of fish. I thought we were getting just wrong answers. Instead it's a more subtle issue of the "two surrogates" instead of "one Unicode codepoint" leaking through the abstraction. This isn't ideal, but might be the tradeoff that's in place. Sorry about the botched demo.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [0aabe07e26] (rid 160169) by sebres on 2018-01-11 14:53:33:
- icomment:
Hi Jan, really <a href="/tcl/artifact?name=84c0c3c6d67c78ff&ln=1450">printf in StringIndexCmd</a>?.. :) Do we need always use `int` instead of `Tcl_UniChar` now by call of Tcl_GetUniChar?... (if/after TIP get merged).
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [7afa1860bb] (rid 160170) by jan.nijtmans on 2018-01-11 15:28:39:
- icomment:
> really printf in StringIndexCmd?.. :) Work in progress ... will be fixed. > Do we need always use `int` instead of `Tcl_UniChar` now by call of Tcl_GetUniChar?... (if/after TIP get merged). Yes, at least if you want to make use of characters >U+FFFF. If you decide to keep using Tcl_UniChar, that's OK too, but then characters in other Unicode planes will be mapped to characters in the BMP. Since Tcl <= 8.6 cannot handle characters >U+FFFF anyway, I consider that an improvement ;-)
- login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [b4e87ec708] (rid 160192) by jan.nijtmans on 2018-01-12 10:05:45:
- closedate changed to: "2458130.92066439"
- closer changed to: "jan.nijtmans"
- icomment: "Fixed in: [de13f558fb5352c9]. Closing."
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"