Commit b272b4b5 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Bug 733722 - XML Output invalid: XML_PROGRAMLISTING=YES copies Unicode form...

Bug 733722 - XML Output invalid: XML_PROGRAMLISTING=YES copies Unicode form feed character (U+000C) to XML files
parent 392b48a2
...@@ -5605,6 +5605,11 @@ QCString convertToXML(const char *s) ...@@ -5605,6 +5605,11 @@ QCString convertToXML(const char *s)
case '&': growBuf.addStr("&"); break; case '&': growBuf.addStr("&"); break;
case '\'': growBuf.addStr("'"); break; case '\'': growBuf.addStr("'"); break;
case '"': growBuf.addStr("""); break; case '"': growBuf.addStr("""); break;
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26:
case 27: case 28: case 29: case 30: case 31:
break; // skip invalid XML characters (see http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char)
default: growBuf.addChar(c); break; default: growBuf.addChar(c); break;
} }
} }
......
...@@ -129,10 +129,10 @@ inline void writeXMLCodeString(FTextStream &t,const char *s, int &col) ...@@ -129,10 +129,10 @@ inline void writeXMLCodeString(FTextStream &t,const char *s, int &col)
{ {
switch(c) switch(c)
{ {
case '\t': case '\t':
{ {
static int tabSize = Config_getInt("TAB_SIZE"); static int tabSize = Config_getInt("TAB_SIZE");
int spacesToNextTabStop = tabSize - (col%tabSize); int spacesToNextTabStop = tabSize - (col%tabSize);
col+=spacesToNextTabStop; col+=spacesToNextTabStop;
while (spacesToNextTabStop--) t << "<sp/>"; while (spacesToNextTabStop--) t << "<sp/>";
break; break;
...@@ -141,11 +141,16 @@ inline void writeXMLCodeString(FTextStream &t,const char *s, int &col) ...@@ -141,11 +141,16 @@ inline void writeXMLCodeString(FTextStream &t,const char *s, int &col)
case '<': t << "&lt;"; col++; break; case '<': t << "&lt;"; col++; break;
case '>': t << "&gt;"; col++; break; case '>': t << "&gt;"; col++; break;
case '&': t << "&amp;"; col++; break; case '&': t << "&amp;"; col++; break;
case '\'': t << "&apos;"; col++; break; case '\'': t << "&apos;"; col++; break;
case '"': t << "&quot;"; col++; break; case '"': t << "&quot;"; col++; break;
default: s=writeUtf8Char(t,s-1); col++; break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26:
case 27: case 28: case 29: case 30: case 31:
break; // skip invalid XML characters (see http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char)
default: s=writeUtf8Char(t,s-1); col++; break;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment