I have PHP and Mysql on my computer. I'm using utf-8 but I have some problems. When I receive utf-8 encoded strings from mysql (using SELECT...) some characters like ô is showed like a question marks on the page but it will work if I write it on the page directly.
I googled and found
That code makes it shows like it should. Is this the way to go or should I set some option elsewhere to not have to set this on every page?
Another question I have is about utf-8 CHAR as primary key. I read somewhere that if you use CHAR in utf-8 it will always take up much more than it have to because it doesn't know how much space it will take. I really want to use CHAR and not numerical values as primary key on some tables. The good thing is that I don't need to use utf-8 characters in these keys (only ASCII-characters) So should I then use some other collation on these rows? witch?
I googled and found
| Code: |
| mysql_query("SET NAMES 'utf8'"); |
Another question I have is about utf-8 CHAR as primary key. I read somewhere that if you use CHAR in utf-8 it will always take up much more than it have to because it doesn't know how much space it will take. I really want to use CHAR and not numerical values as primary key on some tables. The good thing is that I don't need to use utf-8 characters in these keys (only ASCII-characters) So should I then use some other collation on these rows? witch?
