Skip to content
Tcl Source Code Artifact [babf484227]
Login

Artifact [babf484227]

Artifact babf4842271818409ded265d7659d11841087bd1:

Ticket change [babf484227] - Ticket [1665628fffffffff|1665628fff] <i>cannot efficiently modify a ByteArray</i> status still Open with 4 other changes by dkf on 2009-02-05 18:00:18.
D 2009-02-05T18:00:18
J icomment If\syou\sconvert\sa\sstring\swith\scharacters\sin\sthe\s\\u0100-\\uffff\srange\sto\sa\sbyte\sarray,\sthe\shigh\sbyte\sof\sthat\scharacter\sis\sdropped.\sIf\syou\smodify\sthe\sbyte\sarray\sthen\s(e.g.\sby\sTcl_SetByteArrayLength)\sthe\sstring\srep\swill\sbe\sthrown\saway.\sAt\sthat\spoint,\syou'll\shave\slost\sinformation.\sBy\srequiring\sthat\sthere\sbe\sno\sstring\srep\sin\sthe\sfirst\splace,\sthat\smeans\sthat\sthere\scannot\sbe\sany\sinformation\sto\slose\sand\sthe\soperation\sis\ssafe.\s(Otherwise,\sthe\sfallback\sapproach\sof\sworking\swith\sstrings\sis\sused,\swhich\sproduces\scorrect\sresults\sbut\smore\sslowly.)\sTheoretically,\swe\scould\sbe\smore\ssophisticated\sand\srecord\swhether\sthe\sstring\srep\sis\sgenerated\sfrom\sthe\sbytearray\sor\svice\sversa\sand\suse\sthat\sas\sthe\ssafety\sconstraint\s-\swe\sdo\sthe\sequivalent\swith\slists\s-\sbut\sthe\schange\sis\smore\sintrusive\sand\scomplex,\sand\smost\spractical\sbytearrays\swon't\shave\sstring\sreps\sanyway.\n\n
J login dkf
J mimetype text/plain
J username dkf
K 1665628fffffffffffffffffffffffffffffffff
U dkf
Z 32e8078666fc48cb57728809aadc84c0