Differences From Artifact [87273342cc]:
- File src/OFString+JSONParsing.m — part of check-in [b829f3e798] at 2024-08-17 09:51:31 on branch trunk — Move private functions into private headers (user: js, size: 13320) [annotate] [blame] [check-ins using]
To Artifact [08913e2453]:
- File
src/OFString+JSONParsing.m
— part of check-in
[6fbc3b18c7]
at
2024-10-27 22:27:20
on branch trunk
— Allow strings to contain \0
In order to not accidentally have C strings with \0, an
OFInvalidEncodingException is thrown when trying to get a C string for a
string that contains \0.In order to get a C string with \0 anyway, a new method
-[insecureCStringWithEncoding:] is added. (user: js, size: 13386) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
186 187 188 189 190 191 192 193 194 195 196 197 198 199 | buffer[i++] = '\r'; (*pointer)++; break; case 't': buffer[i++] = '\t'; (*pointer)++; break; /* Parse Unicode escape sequence */ case 'u':; OFChar16 c1, c2; OFUnichar c; size_t l; c1 = parseUnicodeEscape(*pointer - 1, stop); | > > > > | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | buffer[i++] = '\r'; (*pointer)++; break; case 't': buffer[i++] = '\t'; (*pointer)++; break; case '0': buffer[i++] = '\0'; (*pointer)++; break; /* Parse Unicode escape sequence */ case 'u':; OFChar16 c1, c2; OFUnichar c; size_t l; c1 = parseUnicodeEscape(*pointer - 1, stop); |
︙ | ︙ |