Tcl Source Code

Artifact [6f3d3ba70d]
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

Artifact 6f3d3ba70da3c2e17c69286b57a3cab9f96bb8c0659c5bb38ef48c8d8a6ce044:

Ticket change [6f3d3ba70d] - Ticket [85ddd247b6] Unable to set channel to binary encoding status still Open with 3 other changes by pooryorick 2024-06-23 22:16:49.
D 2024-06-23T22:16:49.809
J icomment There\sis\sno\s"binary"\sencoding.\s\sAt\sthe\sscript\slevel\sit\swas\salways\sjust\siso8859-1,\sand\salways\swill\sbe.\s\sThis\sis\snot\san\simplementation\sdetail\sleaked\sto\sthe\sscript\slevel,\sjust\sthe\sfact\sthat\sat\sthe\sscript\slevel\sthere\sis\sno\s"binary"\smode,\sand\sthat\s"binary"\swas\salways\sjust\san\sill-advised\ssynonym\sfor\siso8859-1.\s\sAt\sthe\sscript\slevel\sthere\sis\sonly\sUnicode\stext,\sand\sif\sone\swishes\sto\smanipulate\s"binary"\sdata,\sone\smust\sin\sprinciple\stranslate\seach\sincoming\sbyte\sinto\sthe\scorresponding\sUnicode\scode\spoint\s(even\sif\sinternal\soptimizations\slike\sbytearray\selide\sthis\sstep).\s\sIf\seach\scharacter\sin\sthe\stext\shas\sa\scode\spoint\sof\s255\sor\sless,\sit\sis\samenable\sto\sinterpretation\sas\sbytewise\snumerical\svalues\s(binary).\r\n\r\n\r\nIn\sTcl\s8.6,\sconfiguring\sthe\stranslation\sof\sa\schannel\sas\sbinary\sand\sthen\schecking\sconfiguration\syields\sa\stranslation\sof\s"lf",\snot\s"binary",\sand\sthis\shas\salways\sworked\sjust\sfine.\s\sThe\ssame\sshould\sbe\strue\sfor\sencoding:\s\sProgrammers\sshould\sunderstand\sthat\s"binary"\smeans\siso8859-1\s(assuming\sbinary\sisn't\sremoved\sas\san\sencoding).\r\n\r\nIf\sanyone\sis\swriting\scode\sthat\sis\srelying\son\swhether\sthe\sencoding\sfor\sa\schannel\sis\s"binary",\stheir\scode\sis\sprobably\sbuggy,\sand\sit\sprobably\swould\sbe\sless\sbuggy\sif\sTcl\shad\snever\sprovided\s"binary"\sas\san\sencoding\soption\sin\sthe\sfirst\splace.\s\sBinary\sdata\scan\scome\sin\sthrough\sjust\sabout\sany\sencoding.\s\sIt\sdoesn't\smake\smuch\ssense\sto\scondition\scode\son\swhether\sthe\schannel\sencoding\sis\s"binary".\r\n\r\nThere\sis\ssufficient\sintrospection\savailable\salready.\s\sThere\sis\sno\sneed\sfor\sa\s[chan\sisbinary],\sand\sit\swould\sbe\sa\sbad\sidea\sto\sprovide\sit.\s\sIt\sgenerally\smakes\smore\ssense\snot\sto\sintrospect\sthe\sencoding,\sand\sinstead\sto\sjust\sset\sthe\sencoding\sto\swhat\sit\sis\sexpected\sto\sbe.\sI\swould\slike\sto\ssee\sthe\suse\scase\sfor\sintrospecting\sencoding.\r\n\r\nThe\sbest\scourse\sof\saction\swould\sbe\sto\seliminate\s"binary"\sas\san\sencoding,\ssince\sit\snever\sreally\swas\sone,\sand\sleave\s"binary"\sonly\sas\san\sargument\sto\s-translation.
J login pooryorick
J mimetype text/x-fossil-wiki
K 85ddd247b637bcb25990fc55536e0ce3f9e754b2
U pooryorick
Z f96cae4778e6b1fce96b90b876566fb3