Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl_UniCharToUtfDString: 2. arg

Closed / Fixed622120ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 20 days ago
Descriptionplain2002-10-11 22:16:29
Currently, Tcl_UniCharToUtfDString requires, that the
second argument  must  specify  the length of the given
Unicode string. 

Tcl_UtfToUniCharDString, on the other hand, allows -1
as second argument, in which case
Tcl_UtfToUniCharDString  uses strlen  to calculate  the
length of the UTF string to convert. This behavior
feels familiar from Tcl_DStringAppend.

Please consider a similar behavior for
Tcl_UniCharToUtfDString: -1 as second argument should
mean, convert the unicode string to convert up to the
first unicode 0 (Tcl_UniCharToUtfDString should use
Tcl_UniCharLen by itself internaly, if the second arg
is -1).

rolf
dkf Ticket [622120ffff]: 1 change [History diff]2003-02-23 00:25:31
dgp Ticket [622120ffff]: 1 change [History diff]2003-11-13 05:55:54
serhiy.storchakawiki2026-11-13 11:18:45

Since Tcl 9.0, a negative length passed to Tcl_UniCharToUtfDString means that the string is converted up to the first null character, as in Tcl_UtfToUniCharDString.

Log in (anonymous is fine) to add a comment.