Differences From Artifact [2cd0023e53]:
- File
src/OFString+URLEncoding.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 3821) [annotate] [blame] [check-ins using] [more...]
To Artifact [18f43044b2]:
- File src/OFString+URLEncoding.m — part of check-in [179c625d15] at 2016-03-28 19:33:50 on branch trunk — URL encoding: Make sure an unsigned shift is used (user: js, size: 3750) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
48 49 50 51 52 53 54 55 56 57 58 59 | * @"" literal. */ if ((retCString = malloc(([self UTF8StringLength] * 3) + 1)) == NULL) @throw [OFOutOfMemoryException exceptionWithRequestedSize: ([self UTF8StringLength] * 3) + 1]; for (i = 0; *string != '\0'; 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. */ | > > | | < < | | | | | | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | * @"" literal. */ if ((retCString = malloc(([self UTF8StringLength] * 3) + 1)) == NULL) @throw [OFOutOfMemoryException exceptionWithRequestedSize: ([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 (!(c & 0x80) && (isalnum(c) || c == '$' || c == '-' || c == '_' || c == '.' || c == '!' || c == '*' || c == '(' || c == ')' || c == ',' || strchr(ignored, c) != NULL)) retCString[i++] = c; else { unsigned char high, low; high = c >> 4; low = c & 0x0F; retCString[i++] = '%'; retCString[i++] = (high > 9 ? high - 10 + 'A' : high + '0'); retCString[i++] = (low > 9 ? low - 10 + 'A' : low + '0'); } |
︙ | ︙ |