From 1da85f67dffdd6d66bea03396736724a6eed3cfd Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 8 Mar 2006 18:14:42 +0000 Subject: [PATCH] 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 --- ChangeLog | 1 + Source/Additions/GSXML.m | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4a93645f6..58f35d3af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ * Source/NSFileManager.m: don't abort directory copy just because we can't set attributes of destination directory. Don't try to copy directories with their old owners. + * Source/Additions/GSXML.m: Support #x and #X unescaping. * Source/NSSocketPortNameServer.m: * Source/NSBundle.m: * Source/NSProcessInfo.m: diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index 77c82ee85..555e3b0ad 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -4259,7 +4259,15 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use { unichar u; - if ([s hasPrefix: @"�x"] || [s hasPrefix: @"�X"]) + 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: @"�x"] || [s hasPrefix: @"�X"]) { unsigned val = 0;