[Cialug] OT - Python Question

Matthew Nuzum newz at bearfruit.org
Thu Aug 13 09:30:38 CDT 2009


On Thu, Aug 13, 2009 at 9:17 AM, Stuart Thiessen<thiessenstuart at aol.com> wrote:
> Worked on it last night and finally figured out a solution. Your
> comment plus several comments from others focused on the encoding
> issue, so I did a hex dump of the export file and found out what the
> codes were and then used a replace (data.replace('\u____', u'\x__') to
> switch for the equivalent in the lower ASCII set. That did the trick
> to avoid any of the strange symbols. For some strange reason, RTF was
> not reading the Unicode curly quotes, etc. So, it was just simpler to
> replace them all with normal quotes, etc.
>

Well, now that it's too late, I found this which is probably just what
you needed. I'm pretty sure your problem was cp1252 related. There are
a few other chars that you run into that cause probs though the smart
quotes are the most common offenders.

http://effbot.org/zone/unicode-gremlins.htm



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


More information about the Cialug mailing list