Re: [xml] final output filtering?



On Wed, Jun 11, 2003 at 03:32:50PM +0200, Zlatkovic, Igor wrote:
Keeping the #ifdef sounds safer, now if Igor can spot the place where
the "wb" instead of "w" is needed and commit it that would be 
great :-)

Sure I can do that, but how many will put my picture on the wall and throw
darts at it if I do it?

  It's called "delegate" :-)

Right now libxml writes \r\n files to the disc on Windows. Libxml serialises

  err, really ? I was suspecting the gzWrite layer got involved instead
and that one actually does "wb"

\n, and the runtime adds a \r. Doing a xmlParseFile and then xmlSaveFile
effectively converts \n files to \r\n ones. Using "wb" instead of "w" would
reverse the situation, namely a \r\n file would end up converted to \n after
you use the function pair above. I believe quite a few would wish me harm
after such a change.

  Hum, can you confirm it's really the existing behaviour ?

  But, there is a reason to do it. If you are an american, sworn to
ISO-8895-X, then things will work fine without "wb" until...
  ... until someone forces you to use a multibyte-enconding, with the
current locale set to en_US.ISO-8859-1.

  you mean fopen(..., "w", ...) is locale dependant on Windows ? 
/me screams !!!
  Or I misunderstood something ... quite possible.
Anyway by default XML srialization should not be locale dependant,
should save \n\r in a text node as 

 and not turn \n in
a text node to anything else on output.

I would know, how many of you who listen would know misery if I put "wb"
instead of "w"?

  I can't believe all Windows installations are broken by default
and nobody pointed this out before !!!

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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