Overview
Comment: | -[IRIByAddingPercentEncodingForUnicodeCharacters] |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f77acec49808217a3c976013db19e7e7 |
User & Date: | js on 2022-11-25 23:15:31 |
Other Links: | manifest | tags |
Context
2022-11-25
| ||
23:43 | Convert IRIs to URIs where necessary check-in: 1baa99771d user: js tags: trunk | |
23:15 | -[IRIByAddingPercentEncodingForUnicodeCharacters] check-in: f77acec498 user: js tags: trunk | |
20:41 | configure: Add classic macOS check-in: b25b83f1fc user: js tags: trunk | |
Changes
Modified src/OFIRI.h from [4e3a03862f] to [00fdae8a0e].
︙ | |||
155 156 157 158 159 160 161 162 163 164 165 166 167 168 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | + + + + + + | @property (readonly, nonatomic) OFString *string; /** * @brief The IRI with relative subpaths resolved. */ @property (readonly, nonatomic) OFIRI *IRIByStandardizingPath; /** * @brief The IRI with percent-encoding applied to all Unicode characters. */ @property (readonly, nonatomic) OFIRI *IRIByAddingPercentEncodingForUnicodeCharacters; #ifdef OF_HAVE_FILES /** * @brief The local file system representation for a file IRI. * * @note This only exists for IRIs with the file scheme and throws an exception * otherwise. */ |
︙ |
Modified src/OFIRI.m from [f780c28ebe] to [1f73fdc5dd].
︙ | |||
1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 | 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 | + + + + + + + + + + + + + + + + + + + + + + + + + + + | } - (OFIRI *)IRIByStandardizingPath { OFMutableIRI *IRI = [[self mutableCopy] autorelease]; [IRI standardizePath]; [IRI makeImmutable]; return IRI; } - (OFIRI *)IRIByAddingPercentEncodingForUnicodeCharacters { OFMutableIRI *IRI = [[self mutableCopy] autorelease]; void *pool = objc_autoreleasePoolPush(); OFCharacterSet *ASCII = [OFCharacterSet characterSetWithRange: OFMakeRange(0, 0x80)]; IRI.percentEncodedHost = [_percentEncodedHost stringByAddingPercentEncodingWithAllowedCharacters: ASCII]; IRI.percentEncodedUser = [_percentEncodedUser stringByAddingPercentEncodingWithAllowedCharacters: ASCII]; IRI.percentEncodedPassword = [_percentEncodedPassword stringByAddingPercentEncodingWithAllowedCharacters: ASCII]; IRI.percentEncodedPath = [_percentEncodedPath stringByAddingPercentEncodingWithAllowedCharacters: ASCII]; IRI.percentEncodedQuery = [_percentEncodedQuery stringByAddingPercentEncodingWithAllowedCharacters: ASCII]; IRI.percentEncodedFragment = [_percentEncodedFragment stringByAddingPercentEncodingWithAllowedCharacters: ASCII]; [IRI makeImmutable]; objc_autoreleasePoolPop(pool); return IRI; } - (OFString *)description { return [OFString stringWithFormat: @"<%@: %@>", self.class, self.string]; |
︙ |
Modified tests/OFIRITests.m from [91e81f03e0] to [9d4e72c837].
︙ | |||
219 220 221 222 223 224 225 226 227 228 229 230 231 232 | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | + + + + | [[OFIRI IRIWithString: @"HTTP://bar/"] isEqual: IRI3]) TEST(@"-[hash:]", IRI1.hash == IRI4.hash && IRI2.hash != IRI3.hash) EXPECT_EXCEPTION(@"Detection of invalid format", OFInvalidFormatException, [OFIRI IRIWithString: @"http"]) TEST(@"-[IRIByAddingPercentEncodingForUnicodeCharacters]", [IRI11.IRIByAddingPercentEncodingForUnicodeCharacters isEqual: [OFIRI IRIWithString: @"http://%C3%A4/%C3%B6?%C3%BC"]]) mutableIRI = [OFMutableIRI IRIWithScheme: @"dummy"]; EXPECT_EXCEPTION( @"-[setPercentEncodedScheme:] with invalid characters fails", OFInvalidFormatException, mutableIRI.scheme = @"%20") TEST(@"-[setHost:]", |
︙ |