pauldick 01/09/21 13:55:34
Modified: c/Tests/Harness XMLFileReporter.cpp
Log:
printToFile now checks that what it prints is transcodable. If not
we print out a "Error transcoding to local codepage"
Revision Changes Path
1.9 +13 -2 xml-xalan/c/Tests/Harness/XMLFileReporter.cpp
Index: XMLFileReporter.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Harness/XMLFileReporter.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XMLFileReporter.cpp 2001/09/14 21:00:32 1.8
+++ XMLFileReporter.cpp 2001/09/21 20:55:34 1.9
@@ -568,10 +568,21 @@
bool
XMLFileReporter::printToFile(const XalanDOMString& output)
{
+ CharVectorType theResult(TranscodeToLocalCodePage(output));
+
if (isReady())
{
- fprintf(m_fileHandle, &output.transcode().front());
- fprintf(m_fileHandle, "\n");
+ if(!theResult.size())
+ {
+ fprintf(m_fileHandle, "Error transcoding text to local
codepage");
+ fprintf(m_fileHandle, "\n");
+ }
+ else
+ {
+ fprintf(m_fileHandle, c_str(theResult));
+ fprintf(m_fileHandle, "\n");
+ }
+
return true;
}
else
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]