Overview
| Artifact ID: | ed480bcbef7efecb1b73686fbfc3de3cf393f80d |
|---|---|
| Ticket: | af0f23b62fcb3e5d828c78e8b02f19114cfa9d48
Tcl_UniCharToUtf() not conform to documentation |
| User & Date: | gcramer on 2017-05-03 08:57:13 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/html"
- comment changed to:
The documentation of Tcl_UniCharToUtf() says: <verbatim> Tcl_UniCharToUtf stores the Tcl_UniChar ch as a UTF-8 string in starting at buf. The return value is the number of bytes stored in buf. </verbatim> <p> But Tcl_UniCharToUtf(0,buf) stores "\300\200" into buf, this is not an UTF-8 string, it's an anomaly (belongs to MUTF-8), not conform to UTF-8 standard. Either Tcl_UniCharToUtf is erroneous, or the documentation is incomplete. <p> This is a severe problem. If anybody is using this function to store an UTF-8 string in a database, trusting the documentation, it might happen that the database become damaged, because in general no other (properly implemented) UTF-8 based tool is interpreting the anomaly "\300\200". Please note that UTF-8 is not MUTF-8. <p> BTW: The formats MUTF-8, WTF-8, and CESU-8 are not really encoding formats. They are more or less invented for designating results of erroneous UTF-8 implementations, especially the thing with surrogates, a result of an accident (programming error). It's embarrassing if corporates like Microsoft, Sun, et al, are declaring these ill-formed UTF-8 encodings as "UTF-8". Free software should not follow the way of corporates. Here it means: if the result of Unicode point zero is not UTF-8 (<a href="https://tools.ietf.org/html/rfc3629">RFC3629</a>), then this should be explicitly documented.
- foundin changed to: "8.6/8.7"
- is_private changed to: "0"
- login: "gcramer"
- priority changed to: "5 Medium"
- private_contact changed to: "9b7155594aadef44d10a978838b8fe108cdafdd1"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "gcramer"
- subsystem changed to: "44. UTF-8 Strings"
- title changed to: "Tcl_UniCharToUtf() not conform to documentation"
- type changed to: "Bug"