ObjFW  Diff

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]:


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 (!(c & 0x80) && (isalnum(c) || strchr(allowed, c) != NULL))
			retCString[i++] = c;
		else {
			unsigned char high, low;

			high = c >> 4;
			low = c & 0x0F;








|







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;