Support unescaping#x and #X entities

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22623 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-03-08 18:14:42 +00:00
parent b7533dd479
commit 1da85f67df
2 changed files with 10 additions and 1 deletions

View file

@ -4259,7 +4259,15 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
{
unichar u;
if ([s hasPrefix: @"&#0x"] || [s hasPrefix: @"&#0X"])
if ([s hasPrefix: @"&#x"] || [s hasPrefix: @"&#X"])
{
unsigned val = 0;
s = [s substringFromIndex: 3];
sscanf([s UTF8String], "%x", &val);
u = val;
}
else if ([s hasPrefix: @"&#0x"] || [s hasPrefix: @"&#0X"])
{
unsigned val = 0;