Re: error when parsing xml

2005-09-05 Thread Richard Brodie
> > I have found that some people refuse to stick to standards, so whenever I > > parse XML files I remove any characters that fall in the range > > <= 0x1f > > > >>= 0xf0 > > Now of what help shall that be? Get rid of all accented characters? > Sorry, but that surely is the dumbest thing to do he

Re: error when parsing xml

2005-09-05 Thread Diez B. Roggisch
> I have found that some people refuse to stick to standards, so whenever I > parse XML files I remove any characters that fall in the range > <= 0x1f > >>= 0xf0 Now of what help shall that be? Get rid of all accented characters? Sorry, but that surely is the dumbest thing to do here - and has

Re: error when parsing xml

2005-09-05 Thread Diez B. Roggisch
Odd-R. wrote: > This is retrieved through a webservice and stored in a variable test > > > > > ]> > æøå > > printing this out yields no problems, so the trouble seems to be when > executing > the following: > > doc = minidom.parseString(test) You need to do doc = minidom.parseString(test.e

Re: error when parsing xml

2005-09-05 Thread Fredrik Lundh
Odd-R. wrote: > This is retrieved through a webservice and stored in a variable test > > > > > ]> > æøå > > printing this out yields no problems, so the trouble seems to be when > executing < the following: > > doc = minidom.parseString(test) unless we have a cut-and-paste problem here, that

Re: error when parsing xml

2005-09-05 Thread Odd-R.
On 2005-09-05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Odd-R. wrote: > >> I use xml.dom.minidom to parse some xml, but when input >< contains some specific caracters(æ, ø and å), I get an >> UnicodeEncodeError, like this: >> >> UnicodeEncodeError: 'ascii' codec can't encode character >> u'\xe6'

error when parsing xml

2005-09-05 Thread Albert Leibbrandt
>> I use xml.dom.minidom to parse some xml, but when input >> contains some specific caracters(æ, ø and å), I get an >> UnicodeEncodeError, like this: >> >> UnicodeEncodeError: 'ascii' codec can't encode character >> u'\xe6' in position 604: ordinal not in range(128). >> >> How can I avoid this err

Re: error when parsing xml

2005-09-05 Thread Diez B. Roggisch
if you're getting this on the way in, something is broken (posting a short self-contained test program will help us figure out what's wrong). Or he tries to pass a unicode object to parseString. Regards, Diez # -*- coding: utf-8 -*- import xml.dom.minidom dom3 = xml.dom.minidom.parseString(

Re: error when parsing xml

2005-09-05 Thread Fredrik Lundh
Odd-R. wrote: > I use xml.dom.minidom to parse some xml, but when input < contains some specific caracters(æ, ø and å), I get an > UnicodeEncodeError, like this: > > UnicodeEncodeError: 'ascii' codec can't encode character > u'\xe6' in position 604: ordinal not in range(128). > > How can I avoid t

error when parsing xml

2005-09-05 Thread Odd-R.
I use xml.dom.minidom to parse some xml, but when input contains some specific caracters(æ, ø and å), I get an UnicodeEncodeError, like this: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 604: ordinal not in range(128). How can I avoid this error? All help much ap