Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2021-03-18
14:52 • Closed ticket [f9539dce52]: UTF-8 Source code not parsed correctly plus 6 ot... artifact: 01dcabc2a4 user: jan.nijtmans
2014-07-10
14:27 • Ticket [f9539dce52]: 3 changes artifact: 11218d4d62 user: jan.nijtmans
14:27 • Ticket [f9539dce52]: 7 changes artifact: 13ee8d2026 user: jan.nijtmans
04:05 • Ticket [f9539dce52]: 3 changes artifact: 1200bc398a user: samoc
03:54 • Add attachment utf8_test.tcl to ticket [f9539dce52] artifact: ba4e578161 user: samoc
03:53 • New ticket [f9539dce52] UTF-8 Source code not parsed correctly. artifact: 81a6018ca3 user: samoc

UTF-8 Source code not parsed correctly

Closed / Fixedf9539dce52e2dac82090760757763521b583efdeCreated 12 years agoUpdated 6 years ago
Descriptionplain2014-07-10 03:53:25
If I write "puts 😞"
the output is "c3 b0 c2 9f c2 98 c2 9e  0a"
the correct output would be "f0 9f 98 9e 0a"

http://www.charbase.com/1f61e-unicode-disappointed-face
samocplain2014-07-10 04:05:42
It seems (after following the source code from Tcl_SourceObjCmd() all the way through to Tcl_UniCharToUtf()) that "#define TCL_UTF_MAX 3" in tcl.h is the problem.

At the very least there should either be very noticeable warnings in the documentation that say that "UTF-8 is not fully supported and your valid UTF-8 data may be silently corrupted" or there should be an error thrown when a valid UTF-8 character is encountered that is not supported.
jan.nijtmanswiki2014-07-10 14:27:28

At this moment, Characters > 0xffff are not supported. Adding this is ongoing work, being done in implementing TIP 389.

jan.nijtmanswiki2014-07-10 14:27:52

At this moment, Characters > 0xffff are not supported. Adding this is ongoing work, being done in implementing TIP 389.

jan.nijtmanswiki2021-03-18 14:52:22

This is fixed in Tcl 8.6.10

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