ObjFW  Diff

Differences From Artifact [6c7fd6999e]:

  • File src/OFURL.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: 9974) [annotate] [blame] [check-ins using]

To Artifact [cbd9a32b8b]:

  • File src/OFURL.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: 9968) [annotate] [blame] [check-ins using]


81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

		UTF8String = UTF8String2;

		if ((tmp = strstr(UTF8String, "://")) == NULL)
			@throw [OFInvalidFormatException exception];

		for (tmp2 = UTF8String; tmp2 < tmp; tmp2++)
			*tmp2 = tolower((unsigned char)*tmp2);

		_scheme = [[OFString alloc]
		    initWithUTF8String: UTF8String
				length: tmp - UTF8String];

		UTF8String = tmp + 3;








|







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

		UTF8String = UTF8String2;

		if ((tmp = strstr(UTF8String, "://")) == NULL)
			@throw [OFInvalidFormatException exception];

		for (tmp2 = UTF8String; tmp2 < tmp; tmp2++)
			*tmp2 = of_ascii_tolower(*tmp2);

		_scheme = [[OFString alloc]
		    initWithUTF8String: UTF8String
				length: tmp - UTF8String];

		UTF8String = tmp + 3;