Differences From Artifact [c30817026a]:
- File
src/OFString_UTF8.m
— part of check-in
[b83d1414b1]
at
2017-10-29 00:41:52
on branch trunk
— Fix conversion between URL and path on Win32
This also adds -[OFURL fileSystemRepresentation] to correctly convert a
URL back to a path in the local file system. (user: js, size: 30176) [annotate] [blame] [check-ins using]
To Artifact [542fa51776]:
- File src/OFString_UTF8.m — part of check-in [1ec122d57c] at 2017-11-04 16:01:51 on branch trunk — +[stringWithUTF8StringNoCopy:length:freeWhenDone:] (user: js, size: 30396) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
389 390 391 392 393 394 395 396 397 398 | return self; } - (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone { self = [super init]; @try { | > > > > > > > > > > > | > > < < < < < | 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | return self; } - (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone { return [self initWithUTF8StringNoCopy: UTF8String length: strlen(UTF8String) freeWhenDone: freeWhenDone]; } - (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String length: (size_t)UTF8StringLength freeWhenDone: (bool)freeWhenDone { self = [super init]; @try { _s = &_storage; if (freeWhenDone) _s->freeWhenDone = UTF8String; if (UTF8StringLength >= 3 && memcmp(UTF8String, "\xEF\xBB\xBF", 3) == 0) { UTF8String += 3; UTF8StringLength -= 3; } _s->cString = (char *)UTF8String; _s->cStringLength = UTF8StringLength; switch (of_string_utf8_check(UTF8String, UTF8StringLength, &_s->length)) { case 1: _s->isUTF8 = true; break; case -1: @throw [OFInvalidEncodingException exception]; |
︙ | ︙ |