Overview
| Artifact ID: | f67080ea874f52396ac35836622c2f1d73731132 |
|---|---|
| Ticket: | 769812ffffffffffffffffffffffffffffffffff
Tcl_NumUtfChars not as documented |
| User & Date: | dgp on 2003-07-11 19:20:52 |
Changes
- assignee changed to: "nijtmans"
- cmimetype changed to: "text/plain"
- comment changed to:
Documentation for Tcl_NumUtfChars says: Tcl_NumUtfChars corresponds to strlen for UTF-8 strings. It returns the number of Tcl_UniChars that are represented by the UTF-8 string src. The length of the source string is len bytes. If the length is negative, all bytes up to the first NULL byte are used. However, when length is negative, the routine does not stop at the first NULL byte. It stops after the first UTF sequence that converts to the null character, notably \xC0\x80 So, it seems that Tcl_NumUtfChars("\300\200\000", -1) will return 0, when it should return 1. It appears that changing line 506 of revision 1.31 of generic/tclUtf.c from if (ch == '\0') { to if (str[-1] == '\0') { would correct the error. - foundin changed to: "obsolete: 8.4.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "44. UTF-8 Strings"
- title changed to: "Tcl_NumUtfChars not as documented"
- type changed to: "Bug"