• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Diacritical marks are truncated via Active Record

Yes, the problem still exists. In the meantime, I created a hack, that updates the field that might contain a diacritical mark , by using the driver class, like this:

$conn = new mysqli($hostname, $username, $password, $database);
$sql = "UPDATE mytable SET myfield='$myfield' WHERE key = '$key'";

That runs after the insert that looks like this


But yes, this is still a problem.

This is realy a bad solution, but at this time the only that work.
BTW, have you set utf 8 encoding in your view page header, that sends the data?



Actually, at the start of this thread I show that the character string, containing the diacritical mark, is complete in the $values array, just before inserting $values in the database. So it's something in the CI code that's choking on the diacritical character causing it to truncate output (into the database).


I changed my db config from char_set utf8 to utf8mb4.

Here's a solid summary of the issue and solution:

   'char_set' => 'utf8mb4',
   'dbcollat' => 'utf8mb4_general_ci',

The article implies that this solution would work only with PHP versions > 5.5.3, but fortunately it's working fine in v5.3.29.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.