Differences From Artifact [9b57fed9b2]:
- File
src/OFString+URLEncoding.m
— part of check-in
[516517deb3]
at
2016-08-21 14:00:20
on branch trunk
— OFURL: Do not URL decode and reencode parts
URL decoding and reencoding is not lossless: For example, if the query
was foo=bar&qux=foo%25bar, it will be decoded to foo=bar&qux=foo&bar and
then reencoded to foo=bar%25qux=foo%25bar, which is a different thing.The only way to solve this is to let the application handle the URL
decoding and encoding according to its own rules, as those might be
different depending on the application. (user: js, size: 3583) [annotate] [blame] [check-ins using]
To Artifact [6c61b62a6b]:
- File
src/OFString+URLEncoding.m
— part of check-in
[d9eb7b50b3]
at
2017-01-07 00:37:26
on branch trunk
— Add of_ascii_{to{upper,lower},is{alpha,alnum}}
These are independent of the locale and work on the ASCII character set.
Unlike the C ones, these are 8-bit safe, meaning if a character > 0x7F
is passed, is{alpha,alnum} returns false and to{upper,lower} returns the
original character. (user: js, size: 3575) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
55 56 57 58 59 60 61 | unsigned char c = *string; /* * '+' is also listed in RFC 1738, however, '+' is sometimes * interpreted as space in HTTP. Therefore always escape it to * make sure it's always interpreted correctly. */ | | | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | unsigned char c = *string; /* * '+' is also listed in RFC 1738, however, '+' is sometimes * interpreted as space in HTTP. Therefore always escape it to * make sure it's always interpreted correctly. */ if (of_ascii_isalnum(c) || strchr(allowed, c) != NULL) retCString[i++] = c; else { unsigned char high, low; high = c >> 4; low = c & 0x0F; |
︙ | ︙ |