convertfrom utf-8 strict mode allows surrogates in input sequence
Closed / Fixedbd1a60eb9c080fc419473d7fadc6048d5753daa8Created 4 years agoUpdated 4 years ago
Descriptionmarkdown2023-02-11 16:23:52
I think the following is a bug as conformant utf-8 streams are explicitly not permitted to have encoded surrogates.
% proc codepoints {s} {join [lmap c [split $s ""] {
string cat U+ [format %.6X [scan $c %c]]}]
}
% codepoints [encoding convertfrom -strict utf-8 \xed\xa0\x80\xed\xb0\x80]
U+010000
Above should generate an exception.
Looking at fixing (in apn-encoding-profile branch for now, but above sample is from core-8-branch).
Tcl9 behaves as expected.
% codepoints [encoding convertfrom -strict utf-8 \xed\xa0\x80\xed\xb0\x80]
unexpected byte sequence starting at index 0: '\xED'
Referenced by6
8c8deec5ecMerge trunk [de933019a109d3d6]: Fix for [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogates in input sequence. check-in2023-04-16 13:20:5818fe28d8dbMerge trunk de933019a1: Fix for [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogates in input sequence. check-in2023-03-22 12:19:2684f30c5d4eFix for [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogates in input sequence check-in2023-02-14 21:42:01c58db5881eComplete fix for [bd1a60eb9c]. Also fix a bug in the tableencoding. With testcases. check-in2023-02-14 20:50:268dc5e620eeBug [bd1a60eb9c]. Eliminate TCL_ENCODING_UTF. check-in2023-02-14 11:37:3515fba8ddecMake a start fixing [bd1a60eb9c]. WIP check-in2023-02-14 07:29:36
apnadkarni Ticket [bd1a60eb9c]: 3 changes
[History diff]2023-02-11 16:32:24
jan.nijtmans Ticket [bd1a60eb9c]: 3 changes
[History diff]2023-02-13 22:12:17
jan.nijtmanswiki2023-02-15 07:32:15
Fixed now in core-8-branch and trunk
pooryorickwiki2023-04-16 13:21:48
Jan's fix is in [84f30c5d4ee1a14a].
Log in (anonymous is fine) to add a comment.