> > 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
> 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
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
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
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'
>> 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
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(
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
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