mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 04:13:35 +00:00
XML-encode characters below 0x20
svn path=/trunk/; revision=19775
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user