Im having trouble trying to make my mysql database recognise characters such as '
and !
as it seems that everytime I enter a string containing those characters, it converts them into a ?
. I know it has to do with the collation, which i current have set to utf8_bin and i tried utf8_unicode_ci, but am having no luck. Is the collation the problem? if so which of the collation should i use?
Asked
Active
Viewed 28 times
0

ShadowViper
- 365
- 1
- 5
- 24
-
2Check your [Connection Character Set](http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html). For collation, I usually use `utf8_general_ci`. – Raptor Mar 06 '15 at 02:37
-
That just shows how to set one, but how would i know which one to set it to. From what i know, my database is utf8_general_ci – ShadowViper Mar 06 '15 at 02:41
-
Can you show your connection codes? which server language are you using? or are you working on command line only? – Raptor Mar 06 '15 at 02:48
-
im using mysql through phpmyadmin. – ShadowViper Mar 06 '15 at 03:01
-
Bear in mind that phpmyadmin isn't necessarily encoded in UTF8 - the strings you enter might be correct in the database, but if phpmyadmin isn't UTF8 end to end, it won't show them correctly - for more detail see my answer in http://stackoverflow.com/questions/18138097/iso-8859-1-character-truncates-text-inserting-into-utf-8-mysql-column/26876779#26876779 – Peter Barton Mar 06 '15 at 03:49
-
The two characters you mentioned are encoded identically in most CHARACTER SETs, including ascii, latin1, and utf8. Please find the HEX value of the characters so we can help you further. ("Collation" is for sorting and comparing; it is not relevant here.) – Rick James Mar 07 '15 at 02:27