Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-01-21
16:16 • Ticket [d63061a1ac] PRIVATE != CONTROL in Unicode status still Open with 3 o... artifact: f2dfc53016 user: jan.nijtmans
2012-01-10
03:41 • Closed ticket [3464428fff]: string is graph \u0120 is wrong plus 7 other cha... artifact: 1b0d44794e user: nijtmans
2012-01-04
20:51 • Open ticket [3464428fff]. artifact: 0ae60f75f0 user: nijtmans
2011-12-24
07:32 • Closed ticket [3464428fff]. artifact: 58c08510f7 user: nijtmans
2011-12-23
15:11 • New ticket [3464428fff]. artifact: 4f28ba1c83 user: nijtmans

string is graph \u0120 is wrong

Closed / Fixed3464428fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-12-23 15:11:49
This should give 1, but it gives 0
nijtmansplain2011-12-24 07:32:21
allow_comments - 1

fixed on all open branches
nijtmansplain2012-01-04 20:51:50
allow_comments - 0

Re-open, because it appears that some other
characters give wrong results with
"string is graph" (and "string is control"):

%string is graph \u00a0
1
%string is graph \u2028
1
%string is graph \u2029
1

Comparing this with the Ruby implementation:
>/[[:graph:­]]/.match(­"\u00a0")
=> nil
>/[[:graph:­]]/.match(­"\u2028")
=> nil
>/[[:graph:­]]/.match(­"\u2029")
=> nil

This tells us that space (\u0020) is not
the only character that needs to be
excluded from "string is graph", but
all characters in the Unicode SPACE
cathegories ("Zs", "Zl" and "Zp"), which is
indeed more logical

And, while we are on it anyway:
%string is control \u00ad
0
%string is control \ue000
0

Compare this with Ruby:
/[[:cntrl:­]]/.match(­"\u00ad")
=> #<TypeError: can't dump MatchData>
/[[:cntrl:­]]/.match(­"\ue000")
=> #<TypeError: can't dump MatchData>

This tells us that for "string is control" we
need to take the Unicode classes "Cf"
and "Co" in account in addition to "Cc"
(NOT "Cs", because that's for surrogates;
Ruby agrees with that!)

All of those characters are outside of the
ASCII range, which explains why this
was never noticed before.
nijtmansplain2012-01-10 03:41:26
allow_comments - 1

Fixed on all open branches
Log in (anonymous is fine) to add a comment.