mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
XML-encode characters below 0x20
svn path=/trunk/; revision=19775
This commit is contained in:
parent
65ee299192
commit
84de2f0d6d
1 changed files with 7 additions and 1 deletions
|
@ -490,7 +490,13 @@ std::string EncodeXMLString(const XS_String& str)
|
|||
break;
|
||||
|
||||
default:
|
||||
*o++ = *p;
|
||||
if ((unsigned)*p<20 && *p!='\t' && *p!='\r' && *p!='\n') {
|
||||
char b[16];
|
||||
sprintf(b, "&%d;", (unsigned)*p);
|
||||
for(const char*q=b; *q; )
|
||||
*o++ = *q++;
|
||||
} else
|
||||
*o++ = *p;
|
||||
}
|
||||
|
||||
#ifdef XS_STRING_UTF8
|
||||
|
|
Loading…
Reference in a new issue