php - How to store and get exact characters in mysql db? -


content special characters e.g. ' " - when stored replace characters these . not instances of characters changed characters these . little odd why affects characters , not all.

after reading articles online , in found out table collation , charset

  • i using php mysql
  • i use prepared statements when storing , getting values
  • database tables collation set utf8_unicode_ci
  • my pages html5 <meta charset="utf-8">

with above settings still black diamonds. help? little desperate.

edit:

maybe of go through exact same problem in future. might find answer below exact same solution. cheers!

my pages html5 <meta charset="utf-8">

whatever metas quite useless.
page charset determined content-type http header only, have contain proper character set.

$mysqli->set_charset('utf8')/;charset=utf8 in pdo's dsn ought used, seems not issue in case.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -