mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 01:01:03 +00:00
MacOS compatibilityy fixup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24013 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ff1421c20a
commit
1850c6e699
2 changed files with 18 additions and 10 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-11-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSString.m: ([stringByAddingPercentEscapesUsingEncoding:])
|
||||||
|
Make the set of characters escaped compatible with MacOS-X (10.4).
|
||||||
|
|
||||||
2006-11-01 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-11-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSSortDescriptor.m; minor tidyups
|
* Source/NSSortDescriptor.m; minor tidyups
|
||||||
|
|
|
@ -1325,9 +1325,12 @@ handle_printf_atsign (FILE *stream,
|
||||||
* Constructs a new ASCII string which is a representation of the receiver
|
* Constructs a new ASCII string which is a representation of the receiver
|
||||||
* in which characters are escaped where necessary in order to produce a
|
* in which characters are escaped where necessary in order to produce a
|
||||||
* legal URL.<br />
|
* legal URL.<br />
|
||||||
* Escaping is done for any character which is not 'unreserved' according
|
* The original string is converted to bytes using the specified encoding
|
||||||
* to RFC2396. The unreserved characters are letters, digits, and the
|
* and then those bytes are escaped unless they correspond to 'legal'
|
||||||
* set of 'marks' characters ("-_.!~*'()").<br />
|
* ASCII characters. The byte values escaped are any below 32 and any
|
||||||
|
* above 126 as well as 32 (space), 34 ("), 35 (#), 37 (%), 60 (<),
|
||||||
|
* 62 (>), 91 ([), 92 (\), 93 (]), 94 (^), 96 (~), 123 ({), 124 (|),
|
||||||
|
* and 125 (}).
|
||||||
* Returns nil if the receiver cannot be represented using the specified
|
* Returns nil if the receiver cannot be represented using the specified
|
||||||
* encoding.
|
* encoding.
|
||||||
*/
|
*/
|
||||||
|
@ -1351,13 +1354,9 @@ handle_printf_atsign (FILE *stream,
|
||||||
unsigned int hi;
|
unsigned int hi;
|
||||||
unsigned int lo;
|
unsigned int lo;
|
||||||
|
|
||||||
if (isalpha(c) || isdigit(c)
|
if (c <= 32 || c > 126 || c == 34 || c == 35 || c == 37
|
||||||
|| c == '-' || c == '_' || c == '.' || c == '!' || c == '~'
|
|| c == 60 || c == 62 || c == 91 || c == 92 || c == 93
|
||||||
|| c == '*' || c == '\'' || c == '(' || c == ')')
|
|| c == 94 || c == 96 || c == 123 || c == 124 || c == 125)
|
||||||
{
|
|
||||||
dst[dpos++] = c;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
dst[dpos++] = '%';
|
dst[dpos++] = '%';
|
||||||
hi = (c & 0xf0) >> 4;
|
hi = (c & 0xf0) >> 4;
|
||||||
|
@ -1365,6 +1364,10 @@ handle_printf_atsign (FILE *stream,
|
||||||
lo = (c & 0x0f);
|
lo = (c & 0x0f);
|
||||||
dst[dpos++] = (lo > 9) ? 'A' + lo - 10 : '0' + lo;
|
dst[dpos++] = (lo > 9) ? 'A' + lo - 10 : '0' + lo;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dst[dpos++] = c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
[d setLength: dpos];
|
[d setLength: dpos];
|
||||||
s = [[NSString alloc] initWithData: d encoding: NSASCIIStringEncoding];
|
s = [[NSString alloc] initWithData: d encoding: NSASCIIStringEncoding];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue