Overview
| Artifact ID: | 364c4993da71e7a107a087c15c4efb1132915aedc55a0f2e86f59c3ba813bc34 |
|---|---|
| Ticket: | 27944a3661a5e409dead945dbc8f9e4a50033e62
Taming test utf-6.88 |
| User & Date: | dgp on 2020-04-24 12:38:42 |
Changes
- icomment:
I agree that the plainest reading of the existing docs for Tcl_UtNext suggests that the behavior requested in this ticket should be expected. But it has never been present. No existing callers expect it, and no ticket has ever been filed asking for it out of a programming need. We are only doing it now out of a desire to make the code and documentation match. I think the better option is to change the documentation so it more clearly describes what the routine does. (If a programmer has a pointer he suspects points to the middle of a sequence, he can first pass it to Tcl_UtfPrev, which will return a new pointer known to point to a character start. Calling Tcl_UtfNext on that will deliver the overall functionality sought.) Contrast with the coupling of Tcl_UtfNext and Tcl_UtfToUniChar which has been in place in the most direct way -- implementing one in terms of the other -- and which underlies the consistency of indexing that it is much more plausible to imagine existing programs relying on. The need for Tcl_UtfToUniChar to change to satisfy TIP 389 creates a new situation in Tcl 8.7. The incompatibilities have been approved by the TIP at least implicitly. The clarity of calling attention to them might need some improvement. In the current implementation of 8.7, the documented connection between Tcl_UtfNext and Tcl_UtfAtIndex has been broken. I intend to explore some alternatives in a branch that might re-couple UtfNext and UtfToUniChar. I'll open a new ticket to track that, and keep it off the 8.7 branch until it gets some review. Meanwhile I think the collection of new tests has been helpful in uncovering bugs, and we can bring those tests forward, adjust where appropriate, and make fixes for them.
- login: "dgp"
- mimetype: "text/plain"