Overview
| Artifact ID: | 6ef38cdaf2b4e98ecf93463e1e579135348527d49f5409216f849d47eb876f6c |
|---|---|
| Ticket: | 7f1162a8674cc65c9b72169818badc3186f97678
concatenation does not make usable surrogate pairs |
| User & Date: | sebres on 2021-04-13 00:03:23 |
Changes
- icomment:
<i>> Tcl should refuse refuse to work with such invalid data.</i> I have several questions to this statement: <ol> <li>what is exactly valid and invalid in string internal representation?</li> <li>to which time point exactly it becomes not valid? with other words when exactly it should be validated? by call of Tcl_NewStringObj? or may be by something like [/tcl/file?ci=468035ed67ba2ad6&name=generic%2FtclCmdMZ.c&ln=2301|that]: <code><pre> TclNewObj(resultPtr); resultPtr->bytes = string2; resultPtr->length = length2; </pre></code></li> <li>how exactly it is supposed to be refused? Tcl_Panic may be?</li> <li>who decided which method exactly, using which API (I know EIAS, but which one - utf?, byte-array?, unicode?) at C or tcl-level must refuse it?</li> <li>how practicable all that validity stuff will be? (especially considering EIAS, type-less tcl strings, and shimmering on the fly)?</li> <li>and last but not least where it is documented this way and does it not conflict maybe with some API provided by Tcl many many years (for instance as discussed in tclchat reflected channel etc)?</li> </ol> <i>> it doesn't matter how the behaviour illustrated in this issue is "fixed".</i> Well basically it does.<br> Otherwise (if it wouldn't), why just not leave it backwards compatible? :) As for the hackers, I'm really interested to listen the arguments for the case why to consider (an unpaired, single, non-well-formed) byte <code>\x80</code> as an <code>€</code> char (via cp1252) in internal utf representation is less hacking way as to retain it unmodified (as unpaired surrogate, unless it becomes fulfilled or it gets converted somewhere to that what one would expect)? Or why for example not via system encoding? Or why not as <code>Ђ</code> (cp1251)? - login: "sebres"
- mimetype: "text/x-fossil-wiki"