@@ -44,9 +44,11 @@ private static void Parse(List<CharUnicodeInfoTestCase> testCases, string line)
44
44
string charName = data [ 1 ] ;
45
45
string charCategoryString = data [ 2 ] ;
46
46
string numericValueString = data [ 8 ] ;
47
+ StrongBidiCategory bidiCategory = data [ 4 ] == "L" ? StrongBidiCategory . StrongLeftToRight :
48
+ data [ 4 ] == "R" || data [ 4 ] == "AL" ? StrongBidiCategory . StrongRightToLeft : StrongBidiCategory . Other ;
47
49
48
50
int codePoint = int . Parse ( charValueString , NumberStyles . HexNumber ) ;
49
- Parse ( testCases , codePoint , charCategoryString , numericValueString ) ;
51
+ Parse ( testCases , codePoint , charCategoryString , numericValueString , bidiCategory ) ;
50
52
51
53
if ( charName . EndsWith ( "First>" ) )
52
54
{
@@ -59,7 +61,7 @@ private static void Parse(List<CharUnicodeInfoTestCase> testCases, string line)
59
61
{
60
62
// Assumes that all code points in the range have the same numeric value
61
63
// and general category
62
- Parse ( testCases , rangeCodePoint , charCategoryString , numericValueString ) ;
64
+ Parse ( testCases , rangeCodePoint , charCategoryString , numericValueString , bidiCategory ) ;
63
65
}
64
66
}
65
67
}
@@ -99,7 +101,7 @@ private static void Parse(List<CharUnicodeInfoTestCase> testCases, string line)
99
101
[ "Lu" ] = UnicodeCategory . UppercaseLetter
100
102
} ;
101
103
102
- private static void Parse ( List < CharUnicodeInfoTestCase > testCases , int codePoint , string charCategoryString , string numericValueString )
104
+ private static void Parse ( List < CharUnicodeInfoTestCase > testCases , int codePoint , string charCategoryString , string numericValueString , StrongBidiCategory bidiCategory )
103
105
{
104
106
string codeValueRepresentation = codePoint > char . MaxValue ? char . ConvertFromUtf32 ( codePoint ) : ( ( char ) codePoint ) . ToString ( ) ;
105
107
double numericValue = ParseNumericValueString ( numericValueString ) ;
@@ -110,7 +112,8 @@ private static void Parse(List<CharUnicodeInfoTestCase> testCases, int codePoint
110
112
Utf32CodeValue = codeValueRepresentation ,
111
113
GeneralCategory = generalCategory ,
112
114
NumericValue = numericValue ,
113
- CodePoint = codePoint
115
+ CodePoint = codePoint ,
116
+ BidiCategory = bidiCategory
114
117
} ) ;
115
118
}
116
119
@@ -141,11 +144,19 @@ private static double ParseNumericValueString(string numericValueString)
141
144
}
142
145
}
143
146
147
+ public enum StrongBidiCategory
148
+ {
149
+ Other = 0x00 ,
150
+ StrongLeftToRight = 0x20 ,
151
+ StrongRightToLeft = 0x40 ,
152
+ }
153
+
144
154
public class CharUnicodeInfoTestCase
145
155
{
146
156
public string Utf32CodeValue { get ; set ; }
147
157
public int CodePoint { get ; set ; }
148
158
public UnicodeCategory GeneralCategory { get ; set ; }
149
159
public double NumericValue { get ; set ; }
160
+ public StrongBidiCategory BidiCategory { get ; set ; }
150
161
}
151
162
}
0 commit comments