@@ -28,11 +28,12 @@ int _OFString_URLEncoding_reference; @implementation OFString (URLEncoding) - (OFString *)stringByURLEncoding { - return [self stringByURLEncodingWithAllowedCharacters: "$-_.!*()"]; + return [self stringByURLEncodingWithAllowedCharacters: + "-._~!$&'()*+,;="]; } - (OFString *)stringByURLEncodingWithAllowedCharacters: (const char *)allowed { void *pool = objc_autoreleasePoolPush(); @@ -51,15 +52,10 @@ ([self UTF8StringLength] * 3) + 1]; for (i = 0; *string != '\0'; string++) { 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;