check-in [43032d7ba3] potential problems
Closed / Fixed3cd9bea1e66b4fad4b72c61414390c6db2962f6fCreated 7 years agoUpdated 7 years ago
Descriptionplain2019-12-03 00:41:13
From code reading I believe that check-in [43032d7ba3] leaves out corner cases: * it does not check for the return code of the inner TclParseHex() * it requires the second "\u.." escape sequence to have 4 hex digits (which is a required condition for the low surrogate, no complaints about it) * but it will accept "\ud83d\uxyyzz" without proper error handling
Referenced by1
60fab362ceFix [3cd9bea1e6]: check-in [43032d7ba3] potential problems. Also don't allow surrogates in \U?????? syntax. check-in2019-12-03 12:27:42
jan.nijtmanswiki2019-12-03 15:17:02
Fixed in all branches now. Thanks!
The goal of this is to make it almost impossible to create surrogate-pairs when Tcl is compiled with -DTCL_UTF_MAX>3: We want 4-byte UTF-8 sequences always. Of course you can still work around it like:
%set x \uD83D
�
% append x \uDE00
😀
I'm sure there are still other ways to create surrogate pairs as two 3-byte sequences, but this should be discouraged.
Log in (anonymous is fine) to add a comment.