XML-encode characters below 0x20 Modified: trunk/reactos/subsys/system/explorer/utility/xmlstorage.cpp _____
Modified: trunk/reactos/subsys/system/explorer/utility/xmlstorage.cpp --- trunk/reactos/subsys/system/explorer/utility/xmlstorage.cpp 2005-11-30 09:16:21 UTC (rev 19774) +++ trunk/reactos/subsys/system/explorer/utility/xmlstorage.cpp 2005-11-30 11:57:20 UTC (rev 19775) @@ -490,7 +490,13 @@
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