Re: [xml] Adding encoding attribute



On 04 Sep 16:09, Steve Van Esch wrote:
}Another beginner question I'm sure.  I can't figure out how to add an
}encoding attribute to the document.
}
}<?xml version="1.0" encoding="UTF-8"?>
}
}I only have the following:
}
}<?xml version="1.0"?>

As I understand it, encoding is only part of the I/O for a document, so
you will find the ability to use encoding in the Read, Save and Dump
type functions with the Enc suffix. eg.  xmlSaveFormatFileEnc,
xmlDocDumpMemoryEnc and so on. Also, in the text writer functions.

See the testWriter.c example for an example or four.

I think UTF-8 is used exclusively internally, but that shouldn't concern
the programmer that much, except that you need to convert all your inputs
to UTF-8 (according to the comments in testWriter.c).

    C

-- 

Callum Gibson @ home




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