Differences From Artifact [797a478d4d]:
- File
src/OFString_UTF8.m
— part of check-in
[640b225ba7]
at
2012-12-29 17:56:05
on branch trunk
— OFString: Improve API for Unicode strings.
* Instead of Unicode "strings", it uses the term "Unicode character
array".
* No terminating 0 character anymore, as these are not C strings
anyway. (user: js, size: 28916) [annotate] [blame] [check-ins using]
To Artifact [0ddb5e507a]:
- File src/OFString_UTF8.m — part of check-in [c16e6aca56] at 2012-12-30 00:22:55 on branch trunk — Fix -[initWithUTF8StringNoCopy:freeWhenDone:]. (user: js, size: 28864) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
332 333 334 335 336 337 338 | [self release]; @throw e; } return self; } | | | < | | | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | [self release]; @throw e; } return self; } - initWithUTF8StringNoCopy: (char*)UTF8String freeWhenDone: (BOOL)freeWhenDone { self = [super init]; @try { size_t UTF8StringLength = strlen(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 = UTF8String; switch (of_string_utf8_check(UTF8String, UTF8StringLength, &s->length)) { case 1: s->isUTF8 = YES; break; case -1: |
︙ | ︙ |