Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2023-04-16
13:21 • Ticket [bd1a60eb9c] convertfrom utf-8 strict mode allows surrogates in input seq... artifact: 6d2ccba394 user: pooryorick
13:20
Merge trunk [de933019a109d3d6]: Fix for [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogat... check-in: 8c8deec5ec user: pooryorick tags: trunk-encodingdefaultstrict
2023-03-22
12:19
Merge trunk de933019a1: Fix for [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogates in inp... check-in: 18fe28d8db user: pooryorick tags: unchained
2023-02-15
07:32 • Closed ticket [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogates in i... artifact: 7c442acde7 user: jan.nijtmans
2023-02-14
21:42
Fix for [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogates in input sequence check-in: 84f30c5d4e user: jan.nijtmans tags: core-8-branch
20:50
Complete fix for [bd1a60eb9c]. Also fix a bug in the tableencoding. With testcases. closed check-in: c58db5881e user: jan.nijtmans tags: bug-bd1a60eb9c
11:37
Bug [bd1a60eb9c]. Eliminate TCL_ENCODING_UTF. closed check-in: 8dc5e620ee user: apnadkarni tags: apn-encoding-profile
07:29
Make a start fixing [bd1a60eb9c]. WIP check-in: 15fba8ddec user: jan.nijtmans tags: bug-bd1a60eb9c
2023-02-13
22:12 • Ticket [bd1a60eb9c] convertfrom utf-8 strict mode allows surrogates in input seq... artifact: 6fad852ebb user: jan.nijtmans
2023-02-12
17:34
Tentative fix for [bd1a60eb9] - surrogates in strict utf-8 check-in: ea2d05b48b user: apnadkarni tags: apn-encoding-profile
2023-02-11
16:32 • Ticket [bd1a60eb9c] convertfrom utf-8 strict mode allows surrogates in input seq... artifact: cd44f8c912 user: apnadkarni
16:23 • New ticket [bd1a60eb9c]. artifact: 73dfd935df user: apnadkarni

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
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.