title: Python String Encoding - How to Remove "\012" in UTF-8 Strings
body: <p>I'm writing a website/search engine, and the results cannot have characters that are not UTF-8 or my pages get 500 server errors. The results come from a PostgreSQL database, and originally had some non UTF-8 characters. To fix my problem, I used the Python <code>.encode('utf-8')</code> function on my text and then reinserted it into the database. However, now my text has "\012" written through it. Is there anything I can do to the text when I retrieve it to format this away?</p>