[Cialug] OT - Python Question

Matthew Nuzum newz at bearfruit.org
Wed Aug 12 21:17:00 CDT 2009


On Wed, Aug 12, 2009 at 5:29 PM, Stuart Thiessen<thiessenstuart at aol.com> wrote:
> I have a Python question that is bugging me and I've tried to google
> for a solution, but not having much success. Rather than bothering
> everyone with all the details, if you do python programming and you
> think you could let me "pick your brain" for some ideas on how to
> solve it, I'd appreciate it. In short, it has to do with a RTF file
> that my python app is creating based on exported data from another
> application. It keeps replacing quotes with ʉ۪. I've seen what to do
> for html files, but not for this specific situation.

Ah, go ahead and post details to the list if you can. It's not such a
high traffic list that a few more emails will annoy anyone.

I suspect your problem is character encoding related but I'm not sure
and I've never worked with RTF before. However I've seen something
just like this happen when converting between CP1252 and the more
standard UTF or ISO8859-1 charsets.

If that is the case Python has a wonderful solution called
BeautifulSoup which can do a lot of automagical charset conversion
with the UnicodeDammit class.
http://www.crummy.com/software/BeautifulSoup/documentation.html

-- 
Matthew Nuzum
newz2000 on freenode, skype, linkedin, identi.ca and twitter


More information about the Cialug mailing list