You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/09/19 16:51:42 UTC

cvs commit: xml-xalan/c/src/XMLSupport FormatterToXML.cpp

dbertoni    00/09/19 07:51:40

  Modified:    c/src/XMLSupport FormatterToXML.cpp
  Log:
  Changes for AIX port and for output transcoding.
  
  Revision  Changes    Path
  1.26      +20 -4     xml-xalan/c/src/XMLSupport/FormatterToXML.cpp
  
  Index: FormatterToXML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.cpp,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- FormatterToXML.cpp	2000/09/05 02:24:48	1.25
  +++ FormatterToXML.cpp	2000/09/19 14:51:38	1.26
  @@ -67,6 +67,7 @@
   
   
   #include <PlatformSupport/DOMStringHelper.hpp>
  +#include <PlatformSupport/TextOutputStream.hpp>
   #include <PlatformSupport/Writer.hpp>
   
   
  @@ -83,6 +84,7 @@
   };
   
   
  +
   FormatterToXML::FormatterToXML(
   			Writer& 				writer,
   			const XalanDOMString&	version,
  @@ -143,6 +145,16 @@
   		}
   	}
   
  +	if (isEmpty(m_encoding) == false)
  +	{
  +		TextOutputStream* const		theStream = m_writer.getStream();
  +
  +		if (theStream != 0)
  +		{
  +			theStream->setOutputEncoding(m_encoding);
  +		}
  +	}
  +
   	m_isUTF8 = equals(m_encoding, s_utf8EncodingString); // || isEmpty(m_encoding);
   
   	if (equals(m_encoding, s_windows1250EncodingString) == true ||
  @@ -184,17 +196,21 @@
   
   	const unsigned int	nSpecials = length(m_attrSpecialChars);
   
  -	for(unsigned int i = 0; i < nSpecials; ++i)
   	{
  -		m_attrCharsMap[charAt(m_attrSpecialChars, i)] = 'S';
  +		for(unsigned int i = 0; i < nSpecials; ++i)
  +		{
  +			m_attrCharsMap[charAt(m_attrSpecialChars, i)] = 'S';
  +		}
   	}
   
   	m_attrCharsMap[0x0A] = 'S';
   	m_attrCharsMap[0x0D] = 'S';
   
  -	for(i = 160; i < SPECIALSSIZE; i++)
   	{
  -		m_attrCharsMap[i] = 'S';
  +		for(unsigned int i = 160; i < SPECIALSSIZE; i++)
  +		{
  +			m_attrCharsMap[i] = 'S';
  +		}
   	}
   }