RE: [xml] final output filtering?



Zlatkovic, Igor writes:
 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. When you namely request libxml to
output a file in, say, UTF-16BE or perhaps SHIFT-JIS, fwrite will never
know. Fwrite will examine the output stream byte-for-byte and insert a 0x0d
before every 0x0a. That will, at best, destroy every character which
contains a 0x0a somewhere in it's multibyte sequence. If UTF-8 has such
characters, then it will be screwed up as well. 
[0x0a-0x0d] do not belong to ranges of multibytes characters for utf-8/shift-jis/euc/... so with/without 
"wb", their is no side-effect for those multibyte characters... except utf-16

I would know, how many of you who listen would know misery if I put "wb"
instead of "w"?
I won't - on the contrary not having those \r will simplify and normalize processing of those xml generated 
for our cross-platform network applications.

Jean S.




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