[BangPypers] Handling unicode characters in xml.dom

Anand Balachandran Pillai abpillai at gmail.com
Tue Mar 18 06:14:13 CET 2008


What is the encoding of your XML file ? i.e in the
string "<?xml version="1.0" encoding="<encoding>"?>,
what is <encoding> ?

Make sure it is an encoding like utf-8 or iso-8859-1
which can help the parser to understand garbage
chars.

--Anand


On Tue, Mar 18, 2008 at 10:38 AM, Gurpreet Sachdeva
<gurpreet.sachdeva at gmail.com> wrote:
> Hi,
>
> Any idea how to handle the unicode characters existing in an xml file while
> parsing it.
>
> This is what I am doing:
>
> from xml.dom import minidom
>
> xmlObj = minidom.parse(fileobj)
>
> And the script throws an error because of some special characters ['f
> (3gpÕ¡¤ë'] present in the xml file. Any suggestion/pointers would be
> appreciated
>
> Thanks and Regards,
> Gurpreet Singh
> _______________________________________________
>  BangPypers mailing list
>  BangPypers at python.org
>  http://mail.python.org/mailman/listinfo/bangpypers
>
>



-- 
-Anand


More information about the BangPypers mailing list