I'm trying to replace the ' and " characters in the strings I get from
feedparser so I can enter it in the database without getting errors.
Here's what I have right now.

self.title = entry.title.encode('utf-8')
self.title = self.title.replace('\"', '\\\"')
self.title = self.title.replace('\'', '\\\'')

This works just great but is there a more elegent way to do this?  It
looks like maybe I could use the translate method but I'm not sure.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to