[ros-diffs] [mf] 19775: XML-encode characters below 0x20

mf at svn.reactos.com mf at svn.reactos.com
Wed Nov 30 12:57:24 CET 2005


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051130/9b079606/attachment.html


More information about the Ros-diffs mailing list