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.enc ode('utf-8')
self.title = self.title.repl ace('\"', '\\\"')
self.title = self.title.repl ace('\'', '\\\'')
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.
feedparser so I can enter it in the database without getting errors.
Here's what I have right now.
self.title = entry.title.enc ode('utf-8')
self.title = self.title.repl ace('\"', '\\\"')
self.title = self.title.repl ace('\'', '\\\'')
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.
Comment