Differences From Artifact [7a3937da16]:
- File
src/OFString_UTF8.m
— part of check-in
[fcaa549324]
at
2012-10-16 14:47:55
on branch trunk
— A few more API improvements.
This should make it more future-proof, as adding new options is easier
than adding new methods for each and every combination of options. (user: js, size: 30604) [annotate] [blame] [check-ins using]
To Artifact [b90943c641]:
- File src/OFString_UTF8.m — part of check-in [b55b4ab87b] at 2012-12-09 12:31:56 on branch trunk — Fix +[OFString stringWithUTF8StringNoCopy:…]. (user: js, size: 30643) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
401 402 403 404 405 406 407 | @throw e; } return self; } - initWithUTF8StringNoCopy: (const char*)UTF8String | | < < | > > > | 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 430 431 432 433 434 435 436 | @throw e; } return self; } - initWithUTF8StringNoCopy: (const char*)UTF8String freeWhenDone: (BOOL)freeWhenDone_ { self = [super init]; @try { size_t UTF8StringLength = strlen(UTF8String); char *freeWhenDone = (char*)UTF8String; if (UTF8StringLength >= 3 && !memcmp(UTF8String, "\xEF\xBB\xBF", 3)) { UTF8String += 3; UTF8StringLength -= 3; } s = &s_store; s->cString = (char*)UTF8String; s->cStringLength = UTF8StringLength; if (freeWhenDone_) s->freeWhenDone = freeWhenDone; switch (of_string_utf8_check(UTF8String, UTF8StringLength, &s->length)) { case 1: s->isUTF8 = YES; break; case -1: @throw [OFInvalidEncodingException |
︙ | ︙ |