0

When I save François into my DB, it becomes François.

How can I prevent it to keep François ?

During my PDO connection I already use PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8".

Thanks.

F__M
  • 1,518
  • 1
  • 19
  • 34
  • 1
    Please start reading here: http://stackoverflow.com/questions/279170/utf-8-all-the-way-through – arkascha Apr 08 '17 at 16:50
  • 1
    Also you want to take care _not_ to use any fancy "magical" functions like `htmlentities()` and the like... – arkascha Apr 08 '17 at 16:51
  • Apart from that: why do you consider `ç` to be a "special" character? There is no such thing, there are only characters. UTF-8 currently defines a little above 112.000 such characters. None is "special". – arkascha Apr 08 '17 at 16:53

1 Answers1

0

you can change charset to utf8 after starting PDO connection.

$pdo_object = new PDO(...);
$pdo_object->exec("SET NAMES 'utf8'; SET CHARSET 'utf8'");
canozbas
  • 1
  • 2