Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2022-12-01
07:44 • Closed ticket [133456085a]: Tcl 9: Reading UTF-8 data which contains "nonc... artifact: 2942059425 user: jan.nijtmans
2022-11-30
11:11
Merge 8.7. This also fixes [133456085a] check-in: 64badf1d02 user: jan.nijtmans tags: trunk, main
2022-11-28
21:23 • Ticket [133456085a] Tcl 9: Reading UTF-8 data which contains "noncharacter... artifact: a3367c26b2 user: jan.nijtmans
20:42 • New ticket [133456085a]. artifact: d2565f8c7f user: pointsman

Tcl 9: Reading UTF-8 data which contains "noncharacter" code points

Closed / Fixed133456085a95005372096bc16277d54e8cb39b6aCreated 4 years agoUpdated 4 years ago
Descriptionplain2022-11-28 20:42:29
To create the test data simplest is to use a 8.6 tclsh

% info patchlevel
8.6.12
% encoding system
utf-8
% set fd [open test.data w+]
file3
% puts $fd \uffff\uffff\uffffabc
% close $fd

The created file contains the byte sequence

ef bf bf ef bf bf ef bf bf 61 62 63 0a

as expected.

Now try to read this file with Tcl 9:

% info patchlevel
9.0a4
% encoding system
utf-8
% set fd [open test.data]
file6
% set data [read $fd]
% string length $data
0

Ahem, ... what?
Referenced by1
jan.nijtmans Ticket [133456085a]: 3 changes [History diff]2022-11-28 21:23:09
jan.nijtmanswiki2022-12-01 07:44:38

Fixed [here]

Log in (anonymous is fine) to add a comment.