[xml] newline in xmlTextWriter on win32



Hello,

  I'm having difficulty with newlines ("\n") using xmlTextWriter on
Windows.  Instead of writing CRLF to the given output file as is the
windows convention, the text writer is outputting LF (\x0A) alone.  This
happens both when the newline is inserted due to automatic indentation and
when the newline is explicit in an inserted string constant (using
xmlTextWriterWriteFormatString).  I verified that newlines outputed using
fprintf and fwrite to regular files do indeed translate \n into CRLF.  I
poked around very briefly in the libxml2 code, but nothing jumped out at
me as a possible cause.  Does anyohe have an idea as to what could be
causing this problem?

Some details about my setup:
  - Cross-compiling for win32 on Debian GNU/Linux using mingw32-based gcc
        version 3.4.0
  - Using libxml2 version 2.6.10, self-compiled
  - On the windows side, running Win98
  - Text writer created using xmlNewTextWriterFilename()
  - I have tried default encoding (UTF-8?), ISO-8859-1, and plain ASCII

Thanks for your help,
Michael Culbertson



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]