Re: HTML Encoded Translation

2006-10-17 Thread Dave
Got it, great. This worked like a charm. I knew I was barking up the wrong tree with urllib, but I didn't know which tree to bark up... Thanks! Fredrik Lundh wrote: > Dave wrote: > > > How can I translate this: > > > > gi > > > > to this: > > > > "gi" > > the easiest way is to run it through an H

Re: HTML Encoded Translation

2006-10-17 Thread Sybren Stuvel
Dave enlightened us with: > How can I translate this: > > gi > > to this: > > "gi" > > I've tried urllib.unencode and it doesn't work. As you put so nicely in the subject: it is HTML encoding, not URL encoding. Those are two very different things! Try a HTML decoder, you'll have more luck with tha

Re: HTML Encoded Translation

2006-10-17 Thread Fredrik Lundh
Dave wrote: > How can I translate this: > > gi > > to this: > > "gi" the easiest way is to run it through an HTML or XML parser (depending on what the source is). or you could use something like this: import re def fix_charrefs(text): def fixup(m): text = m.

HTML Encoded Translation

2006-10-17 Thread Dave
How can I translate this: gi to this: "gi" I've tried urllib.unencode and it doesn't work. Thanks! -- http://mail.python.org/mailman/listinfo/python-list