58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
OFFile *file = [OFFile fileWithPath: path
mode: @"rb"];
OFString *line;
pool2 = [[OFAutoreleasePool alloc] init];
while ((line = [file readLine])) {
OFArray *split;
OFString **splitCArray;
of_unichar_t codep;
split = [line componentsSeparatedByString: @";"];
if ([split count] != 15) {
of_log(@"Invalid line: %@\n", line);
[OFApplication terminateWithStatus: 1];
}
splitCArray = [split cArray];
codep = (of_unichar_t)[splitCArray[0] hexadecimalValue];
upperTable[codep] =
(of_unichar_t)[splitCArray[12] hexadecimalValue];
lowerTable[codep] =
(of_unichar_t)[splitCArray[13] hexadecimalValue];
[pool2 releaseObjects];
}
[pool release];
}
- (void)readCaseFoldingFileAtPath: (OFString*)path
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2;
OFFile *file = [OFFile fileWithPath: path
mode: @"rb"];
OFString *line;
pool2 = [[OFAutoreleasePool alloc] init];
while ((line = [file readLine])) {
OFArray *split;
OFString **splitCArray;
of_unichar_t codep;
if ([line characterAtIndex: 0] == '#')
continue;
split = [line componentsSeparatedByString: @"; "];
if ([split count] != 4) {
of_log(@"Invalid line: %s\n", line);
[OFApplication terminateWithStatus: 1];
}
splitCArray = [split cArray];
if (![splitCArray[1] isEqual: @"S"] &&
![splitCArray[1] isEqual: @"C"])
continue;
codep = (of_unichar_t)[splitCArray[0] hexadecimalValue];
casefoldingTable[codep] =
(of_unichar_t)[splitCArray[2] hexadecimalValue];
[pool2 releaseObjects];
}
[pool release];
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
OFFile *file = [OFFile fileWithPath: path
mode: @"rb"];
OFString *line;
pool2 = [[OFAutoreleasePool alloc] init];
while ((line = [file readLine])) {
OFArray *split;
OFString **splitObjects;
of_unichar_t codep;
split = [line componentsSeparatedByString: @";"];
if ([split count] != 15) {
of_log(@"Invalid line: %@\n", line);
[OFApplication terminateWithStatus: 1];
}
splitObjects = [split objects];
codep = (of_unichar_t)[splitObjects[0] hexadecimalValue];
upperTable[codep] =
(of_unichar_t)[splitObjects[12] hexadecimalValue];
lowerTable[codep] =
(of_unichar_t)[splitObjects[13] hexadecimalValue];
[pool2 releaseObjects];
}
[pool release];
}
- (void)readCaseFoldingFileAtPath: (OFString*)path
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2;
OFFile *file = [OFFile fileWithPath: path
mode: @"rb"];
OFString *line;
pool2 = [[OFAutoreleasePool alloc] init];
while ((line = [file readLine]) != nil) {
OFArray *split;
OFString **splitObjects;
of_unichar_t codep;
if ([line length] == 0 || [line hasPrefix: @"#"])
continue;
split = [line componentsSeparatedByString: @"; "];
if ([split count] != 4) {
of_log(@"Invalid line: %s\n", line);
[OFApplication terminateWithStatus: 1];
}
splitObjects = [split objects];
if (![splitObjects[1] isEqual: @"S"] &&
![splitObjects[1] isEqual: @"C"])
continue;
codep = (of_unichar_t)[splitObjects[0] hexadecimalValue];
casefoldingTable[codep] =
(of_unichar_t)[splitObjects[2] hexadecimalValue];
[pool2 releaseObjects];
}
[pool release];
}
|