1

I've inserted arabic characters into my database and as they're being displayed as question marks

I use SafeMySQL class to connect to the database and I set my charset to utf8 All my tables are set to utf8_general_ci and my database is also set to utf8_general_ci

I force a utf8 encoding in htaccess and inside the html

Does anyone have any idea what may have been left out of this that is still displaying arabic characters as question marks?

Ali
  • 3,479
  • 4
  • 16
  • 31

1 Answers1

0

I am the author of SafeMysql. By default this library is using utf8 encoding, so there should be no problem with database connection encoding, unless you are explicitly setting some other encoding.

From the error message you gave in comments,

Warning: #1366 Incorrect string value: '\xD9\x85\xD8\xAB\xD8\xA7...' for column 'report_message' at row 1

I would say that you have to double-check your table's (and fields) charset.

Run the following query and see, if the table's definition indeed contain utf8 in all respective places:

DESCRIBE TABLE table_name
Your Common Sense
  • 156,878
  • 40
  • 214
  • 345