[xiph-commits] r9207 - trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags

ozone at motherfish-iii.xiph.org ozone at motherfish-iii.xiph.org
Tue May 3 21:58:05 PDT 2005


Author: ozone
Date: 2005-05-03 21:58:03 -0700 (Tue, 03 May 2005)
New Revision: 9207

Modified:
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp
Log:
oggdsf:
 * Don't blanket-replace entities when importing CMML files, since anything that uses libCMMLTags to do its encoding more than once will end up having doubly-escaped entities


Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp	2005-05-04 04:18:40 UTC (rev 9206)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp	2005-05-04 04:58:03 UTC (rev 9207)
@@ -92,13 +92,21 @@
 wstring C_CMMLTag::escapeEntities(wstring inString)
 {
 	wstring retStr = inString;
-	//Do the ampersand first !!
-	retStr = replaceAll(retStr, L'&', L"&");
-	retStr = replaceAll(retStr, L'<', L"&lt;");
-	retStr = replaceAll(retStr, L'>', L"&gt;");
-	retStr = replaceAll(retStr, L'"', L"&quot;");
-	retStr = replaceAll(retStr, L'\'', L"&apos;");
 
+	// Note: We don't escape try to escape entities right now, since otherwise
+	// anything XML files that get encoded more than once by libCMMLTags will
+	// get encoded twice  (e.g. < will get encoded the first time as &lt;
+	// which is correct, but that'll then get encoded as &amp;lt;, which is
+	// incorrect.)  Better to leave these few characters alone for now rather
+	// than have very ugly doubly-escaped characters!
+
+	////Do the ampersand first !!
+	//retStr = replaceAll(retStr, L'&', L"&amp;");
+	//retStr = replaceAll(retStr, L'<', L"&lt;");
+	//retStr = replaceAll(retStr, L'>', L"&gt;");
+	//retStr = replaceAll(retStr, L'"', L"&quot;");
+	//retStr = replaceAll(retStr, L'\'', L"&apos;");
+
 	return retStr;
 
 }



More information about the commits mailing list