Skip to content
Tcl Source Code Artifact [632d1f48e7]
Login

Artifact [632d1f48e7]

Artifact 632d1f48e742032f7b93e14724079f76f0a9807e9b62ccfc9d7b44b3fc71ffb5:

Ticket change [632d1f48e7] - Ticket [535705ffffffffff|535705ffff] <i>Tcl interface to stop on encoding errors</i> status still Open with 3 other changes by jan.nijtmans on 2021-05-07 10:06:38.
D 2021-05-07T10:06:38.150
J icomment >\sI\sam\snot\sin\sfavor\sto\sinclude\sthe\sbyte\svalue\sin\shex\sof\sthe\sinput\sbyte\scausing\sthe\sconversion\serror.\sThe\sreasons\sare:\s...\r\n\r\nWell,\show\sabout\sa\sbetter\serror-message\sthen?\sThe\sfirst\sbyte\sof\sinvalid\sUTF-8\stells\ssomething\suseful:\sIf\sit\sis\sbetween\s0x80-0xBF\sor\s0xC1\sor\sbetween\s0xF8-0xFF\sthen\sthat's\sthe\serror-byte.\sIf\sit\sis\s0xC0\sor\sbetween\s0xC2-0xF7\sthen\sit's\sa\sfollow-up\sbyte\sproblem.\r\n\r\n>\sWhen\sconverting\sto\sa\ssingle\sbyte\sencoding\s(example\sISO-8859-1),\sthe\serror\sbyte\svalue\swill\sbe\sthe\sfirst\sbyte\sof\san\sutf-8\ssequence.\sIMHO\sthis\scauses\smore\sissues\sthan\sit\shelps.\r\n\r\nThe\serror-message\scontains\sthe\scharacter\svalue\sin\sthis\scase,\snot\sa\sbyte\svalue.\sIt\sshows\sthe\scharacter\scode,\swhich\smust\sbe\s<\s0xFF\sfor\sISO-8859-1.\r\n\r\nI\schanged\sthe\serror-message\snow\sto\s"unexpected\sbyte\ssequence\sstarting\sat\sindex\s..."
J login jan.nijtmans
J mimetype text/x-fossil-wiki
K 535705ffffffffffffffffffffffffffffffffff
U jan.nijtmans
Z 1cdc00e904ac62e3c8f3e252d99d8bd5