0

I have a problem when i want to display some data from my controller, in my twig. The data is truncated only in production env, i don't know why.

In local env : OSX 10.14.1 - PHP 7.2.12 In prod env : Debian 8 - PHP 7.2.14-1+0~20190113100657.14+jessie~1.gbpd83c69

This is my code:

$sqlNotes = sprintf("SELECT CN_ID, CN_NOTE, INS_DATE, INS_USER FROM %s.dbo.CLIENTS_NOTES WHERE CL_ID = :cl_id ORDER BY INS_DATE DESC", $so_database);

$stmtNotes = $conn->prepare($sqlNotes);
$stmtNotes->bindValue('cl_id', $id);
$stmtNotes->execute();
$notes = $stmtNotes->fetchAll();

When i dump my data in local env (dev) i have this output:

Eu Mr Charles Régnault. Très sympathique mais mon appel était très succint. Je lui ai présenté la centrale, parlé de Bruneau. ils passent par Bruneau Vallée. Il m'a dit que pour les impressions ils ont un fournisseur pour les agences réunies de Bretagne.

But when i am on my production server (prod) i have this output:

Eu Mr Charles Régnault. Très sympathique mais mon appel était très succint. Je lui ai présenté la centrale, parlé de Bruneau. ils passent par Bruneau Vallée. Il m'a dit que pour les impressions ils ont un fournisseur pour les agences réunies de B

Thanks for u attention

jibeeeee
  • 152
  • 2
  • 17
  • Not sure what you mean with truncating, to me it seems your production env is outputting the `UTF-8` correctly, whilst your development env is not – DarkBee Mar 14 '19 at 14:46
  • Try `$conn->query("SET character_set_client = 'UTF-8'");` before – SilvioQ Mar 14 '19 at 14:49
  • it's not an encoding problem i think. In the website, i have different places, this is the only place i don't have all the data. – jibeeeee Mar 14 '19 at 14:55
  • @SilvioQ i'm using sql server database – jibeeeee Mar 14 '19 at 14:58
  • Please, tell us OS (Windows/Linux). If you use TDS, this is a hint https://stackoverflow.com/questions/13377812/getting-data-with-utf-8-charset-from-mssql-server-using-php-freetds-extension – SilvioQ Mar 14 '19 at 15:06
  • @SilvioQ this solution doesn't help me :( – jibeeeee Mar 14 '19 at 15:16
  • [related](https://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – DarkBee Mar 14 '19 at 15:21
  • @DarkBeeThnks for your reply. I'm using SQL server 2008 ... BTW i already read this .. – jibeeeee Mar 14 '19 at 15:30
  • The related topic is not only talking about the database connection. Make sure all your physicals files are encoded properly and you are settings the correct content type to the output as well. – DarkBee Mar 14 '19 at 15:44

0 Answers0