Le Thu, Aug 01, 2002, à 10:19:24AM -0500, Lars Clausen a écrit:
> Well, libxml2 doesn't seem to be doing it for Dia now. I don't know what's
> wrong with it.
libxml2 does the right thing. If you don't have an encoding spec in the
header of an XML file, then it's UTF-8. If you pass UTF-8 data to libxml and
don't ask for another encoding spec, you'll get an UTF-8 header. This is
within spec.
What wasn't right, was that libxml1 (and dia up to and including 0.88.1) saved
with no encoding spec the raw 8-bit data in local encoding. And if you
passed UTF-8 data to libxml1, it corrupted it.
There is normally code in dia_xml.c (IIRC) which checks the header, and puts
an explicit encoding header if it is absent. This might need revision since
we switched to libxml2, but please guys don't reinvent the wheel, this was
news for dia in early 2001 (and it was news for the libxml maintainers
sometime around Vercingetorix' surrender, 52 BC)
-- Cyrille
--
Grumpf.