The docs of Tcl_ExternalToUtf() are unclear on the
boundaries of the write buffer. They say "... and up
to dstLen converted bytes are stored in dst." which
suggests bytes will be written in dst up
to dst[dstLen-1]. And that appears to be an accurate
description of what the underlying ToUtfProc() does.
However, then Tcl_ExternalToUtf() appends a terminating
NUL character, and if the ToUtfProc has used all dstLen
bytes, T_ETU writes to dst[dstLen].