diff options
author | dgp <dgp@users.sourceforge.net> | 2014-12-23 18:39:35 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-12-23 18:39:35 (GMT) |
commit | c826f6d268355204eeef4506cec6a8948cc290a3 (patch) | |
tree | 94a25cd0a1f31aa5532c59bd74202b7469ab8311 /generic/tclBasic.c | |
parent | dd4496550090acf79f5e144602c745533549eea5 (diff) | |
parent | efce992c9a86e2e12f0142274afa9d58012b5870 (diff) | |
download | tcl-c826f6d268355204eeef4506cec6a8948cc290a3.zip tcl-c826f6d268355204eeef4506cec6a8948cc290a3.tar.gz tcl-c826f6d268355204eeef4506cec6a8948cc290a3.tar.bz2 |
Add two new (undocumented) flags to the Tcl_ExternalToUtf() interface.
TCL_ENCODING_NO_TERMINATE rejects the default behavior of appending a
terminating NUL byte to the produced Utf output. This permits use of all
of the dstLen bytes provided, and simplifies the buffer size calculations
demanded from callers. Perhaps some callers need or appreciate this default
behavior, but for Tcl's own main use of encodings - conversions within I/O -
this just gets in the way.
TCL_ENCODING_CHAR_LIMIT lets the caller set a limit on the number of chars
to be output to be enforced by the encoding routines themselves. Without
this, callers have to check after the fact for going beyond limits and
make multiple encoding calls in a trial and error approach.
Full compatibility is supported. No defaults are changed, and the flags
have their effect even if an encoding driver has not been written to support
these flags (but greater efficiency is enjoyed if they do!).
All of Tcl's own encoding drivers are updated to support this. Other encoding
drivers may exist somewhere, but I cannot point to any.
A TIP to document this and make it officially supported may come in time.
Diffstat (limited to 'generic/tclBasic.c')
0 files changed, 0 insertions, 0 deletions