Ι’ve tried all the solution that I could find, but nothing seems to work:
teext = str(self.tableWidget.item(row, col).text())
I’m writing in greek by the way…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Clearly,
self.tableWidget.item().text()returns Unicode, and you need to use thedecodemethod instead:You really want to review the Python Unicode HOWTO to fully appreciate the difference between a unicode object and it’s byte encoding.
Another excellent article is The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!), by Joel Spolsky (one of the people behind Stack Overflow).