Publisher review:Detect character encoding in an XML file script contains a function that analyzes an open xml file for its characters encoding. This script contains a function that analyzes an open xml file for its characters encoding by - checking for a unicode BOM or (on failure); - searching the xml declaration at the beginning of the file for the "encoding" attribute ;
It attempts to detect the character encoding of the xml file given by a file object that must not be a codec wrapped file object.
The return value can be:
- if detection of the BOM succeeds, the codec name of the corresponding unicode charset is returned
- if BOM detection fails, the xml declaration is searched for the encoding attribute and its value returned. the "
Detect character encoding in an XML file is a Python script for XML Tools scripts design by Lars Tiede.
It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
contains a function that analyzes an open xml file for its characters encoding.
Operating system:Windows / Linux / Mac OS / BSD / Solaris