Tcl Source Code

View Ticket
Login
Ticket UUID: db7a085bd95a1169ece64db4a9b7af506e323b21
Title: encoding convertfrom -strict utf-16 accepts partial surrogates
Type: Bug Created on: 2023-02-20 13:07:08
Submitter: apnadkarni Assigned to: jan.nijtmans
Subsystem: - New Builtin Commands Severity: Important
Priority: 5 Medium Last modified: 2023-03-14 10:17:53
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2023-03-14 10:17:53
Version: 8.7
Description:
% codepoints [encoding convertfrom -strict utf-16le \x00\xd8]
U+00D800
% codepoints [encoding convertfrom -strict utf-16le \x00\xdc]
U+00DC00
% codepoints [encoding convertfrom -strict utf-16be \xd8\x00]
U+00D800

I don't think this is conformant behavior and should raise an error.

/Ashok

User Comments:
jan.nijtmans added on 2023-02-23 11:09:33:

This is - indeed - non-conformat behavior


jan.nijtmans added on 2023-03-11 22:02:39:

Proposed fix [3840dcf4c96e21ad|here] for 9.0. TODO: add more testcases.

Also missing is the implementation for 8.7, which is slightly more difficult because Tcl8.7 doesn't have the TCL_COMBINE flag.


jan.nijtmans added on 2023-03-14 10:17:53:

Fixed [8a26d5cf2bb74d68|here]