L2/15-333 Title: Correction for Bidi_Paired_Bracket Mapping of Brackets with Ticks Source: Ken Whistler Date: August 24, 2015 Status: For consideration by the UTC Background In an observation and query posted on the Unicode email list, Nigel Small recently pointed out that there is an anomaly in the Bidi_Paired_Bracket mapping for the four mathematical brackets with diagonal ticks, to wit: 298D; 2990; o # LEFT SQUARE BRACKET WITH TICK IN TOP CORNER 298E; 298F; c # RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER 298F; 298E; o # LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER 2990; 298D; c # RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER The anomaly is that the mappings do not follow the open/close pairings implicit in the Unicode names list, but rather follow the listings derived from informative glyph pairings in BidiMirroring.txt. Because the bracket pair matching portion of the UBA is designed to catch actual bracket pairs, the question arises as to whether the intent of the standard is for these brackets to pair in code point order, i.e.: 298D (opening) <==> 298E (closing) 298F (opening) <==> 2990 (closing) or if the intent is for these brackets to pair in terms of their lateral glyphic symmetry, as per BidiMirroring.txt: 298D; 2990 # LEFT SQUARE BRACKET WITH TICK IN TOP CORNER 298E; 298F # RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER 298F; 298E # LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER 2990; 298D # RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER i.e.: 298D (opening) <==> 2990 (closing) 298F (opening) <==> 298E (closing) Opinion in the subsequent discussion varied, but the consensus which emerged is that the code point order reflects intended pairing, and that the use of the diagonal ticks can be interpreted as intended to pair the bracketing with either a *diagonal* or an *anti-diagonal* matching of the corner ticks. If this is the case -- and I concur that this is the best interpretation of the original intent of the bracket pairs -- then the mappings in BidiBrackets.txt are incorrect and should be fixed. The question might further arise as to whether the glyph mapping values in BidiMirroring.txt are also incorrect. However, those mappings have been around much longer (13+ years, as opposed to 2 years for the Bidi_Paired_Bracket mappings). More importantly, the values in BidiMirroring.txt are explicitly for *glyph* mirroring: they represent the informative value of the Bidi_Mirroring_Glyph property. And it would be perverse to change a *correct* visual mapping of mirroring glyphs of 13-year plus standing, to an *incorrect* visual mapping, which would then require implementations to make further substitutions to recover the actual mirroring glyph information. So I think the BidiMirroring.txt values are correct as is. What needs to be corrected is two-fold: first the actual mapping values for these two bracket pairs in BidiBrackets.txt *and* second the assumption that Bidi_Paired_Bracket mappings must necessarily exactly match Bidi_Mirroring_Glyph mappings. ===================================================================== Proposal I suggest that for Unicode 9.0, the mappings for these two bracket pairs be updated in BidiBrackets.txt to: # WARNING: The following four brackets are intended to be # matched for bracket pairing as shown here. This pairing # reflects the intended semantics of these bracket pairs, # where the 298D/298E pair matches diagonal ticks in an # anti-diagonal orientation and the 298F/2990 pair matches # diagonal ticks in a diagonal orientation. # # This semantic pairing of brackets affects their matching # for the Unicode Bidirectional Algorithm. Note, however, # that this mapping for Bidi_Paired_Bracket does NOT # match the laterally symmetric visual mapping of these # brackets for Bidi_Mirroring_Glyph (see BidiMirrored.txt). # Implementers are warned: YOU WILL GET THIS WRONG. # So come back here to discover why when you get the bug # reports. ;-) 298D; 298E; o # LEFT SQUARE BRACKET WITH TICK IN TOP CORNER 298E; 298D; c # RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER 298F; 2990; o # LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER 2990; 298F; c # RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER