Forums

Questionmarks instead of Word

Hey,

I have a word 'комоди' which is stored in my sb (MySQL) and it is stored just like that. However, when I try display that on a webpage it comes back as '?????'.

Anyone know what the issue is and how I might fix it?

The most likely issue is that the page you're serving specifies a different encoding to the encoding that the text is stored as. It could also be any step in between the database and the page that may be mangling the encoding.

Yea, that's what I thought, but I checked the db encoding and it's utf8 as is the script reading it (as declared at the top of the script) and so is the webpage.

It's always the case, you ask for help and then figure it out!!

I added self.cursor.execute("set names utf8;") to my db call and the within the script .decode('utf-8') and that's done the trick

Yup, it's always the way, isn't it :-) Glad you worked it out!