Re: minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
On 3/7/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Abhimanyu Seth wrote:> Sorry, my mistake. The file was not saved as utf-8. Saving it as utf-8> solves my problems.> >> f = codecs.open ("c:/test.txt", "r", "utf-8") > >> dom = minidom.parseString (codecs.encode (f.read(), "utf-8"))>> However, I st

Re: minidom and unicode errors

2006-03-06 Thread Fredrik Lundh
Abhimanyu Seth wrote: > Sorry, my mistake. The file was not saved as utf-8. Saving it as utf-8 > solves my problems. > >> f = codecs.open ("c:/test.txt", "r", "utf-8") > >> dom = minidom.parseString (codecs.encode (f.read(), "utf-8")) > > However, I still need to encode the string returned by f.re

Re: minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
On 3/7/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Abhimanyu Seth wrote:> > I have the following line in my xml file:> > Exception beim Löschen des Audit-Moduls aufgetreten. Exception> Stack> > lautet: %1. > > ExpatError: not well-formed (invalid token): line 8, column 27> I've specified utf-8 in

Re: minidom and unicode errors

2006-03-06 Thread Fredrik Lundh
Abhimanyu Seth wrote: > > I have the following line in my xml file: > > Exception beim Löschen des Audit-Moduls aufgetreten. Exception > Stack > > lautet: %1. > > ExpatError: not well-formed (invalid token): line 8, column 27 > I've specified utf-8 in the xml header > are you sure you're using

Re: minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
On 3/7/06, Abhimanyu Seth <[EMAIL PROTECTED]> wrote: On 3/7/06, Fredrik Lundh < [EMAIL PROTECTED]> wrote: Abhimanyu Seth wrote:> I'm trying to parse and modify an XML document using xml.dom.minidom module> and Python 2.4.2>> >> from xml.dom import minidom> >> dom = minidom.parse ("c:/test.txt")>

Re: minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
On 3/7/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Abhimanyu Seth wrote:> I'm trying to parse and modify an XML document using xml.dom.minidom module> and Python 2.4.2>> >> from xml.dom import minidom> >> dom = minidom.parse ("c:/test.txt")>> If the xml file contains a non-ascii character, then i

Re: minidom and unicode errors

2006-03-06 Thread Fredrik Lundh
Abhimanyu Seth wrote: > I'm trying to parse and modify an XML document using xml.dom.minidom module > and Python 2.4.2 > > >> from xml.dom import minidom > >> dom = minidom.parse ("c:/test.txt") > > If the xml file contains a non-ascii character, then i get a parse error. > I have the following li