Differences From Artifact [293372453e]:
- File src/OFString_UTF8.m — part of check-in [0832fcf579] at 2017-01-10 23:23:40 on branch trunk — Add Mac OS Roman encoding (user: js, size: 28786) [annotate] [blame] [check-ins using]
To Artifact [38f6296657]:
- File
src/OFString_UTF8.m
— part of check-in
[a9f85ba3b1]
at
2017-01-11 03:49:27
on branch trunk
— Use U+FFFF for invalid characters
This used to be U+FFFD, but if a character is not assigned in an
encoding, U+FFFF is a better match. (user: js, size: 28786) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
316 317 318 319 320 321 322 | if (!(cString[i] & 0x80)) { _s->cString[j++] = cString[i]; continue; } character = table[(uint8_t)cString[i] - 128]; | | | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | if (!(cString[i] & 0x80)) { _s->cString[j++] = cString[i]; continue; } character = table[(uint8_t)cString[i] - 128]; if (character == 0xFFFF) @throw [OFInvalidEncodingException exception]; _s->isUTF8 = true; characterBytes = of_string_utf8_encode(character, buffer); if (characterBytes == 0) |
︙ | ︙ |