Hello @johnny,
System data:
- PHP8.1, GC 3.0.9, CI 4.3.7
- Table field varchar(255), table charset utf8mb3
GC DB Adapter configured with
'driver' => 'mysqli', // (with Pdo_Mysql exactly the same behaviour)
...
'charset' => 'utf8',
Field contain the text (copied 1:1 directly from database):
<p>Dirk van Gunsteren, 1953 geboren, übersetzte u.a. Jonathan Safran Foer, Colum McCann, Thomas Pynchon, Philip Roth, T.C. Boyle und Oliver Sacks. 2007 erhielt er den Heinrich Maria Ledig-Rowohlt-Preis.</p>
<p>Oliver Sacks, geboren 1933 in London, war Pro
(the text is exactly 255 symbols long, you can check it)
This content will be correct presented if record called to view and will be correct added in form field if record called for edit, but if you want to save this record from edit it produce CI error, hier is the trace:
CRITICAL - 2023-08-10 15:01:42 --> SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'redaktion' at row 1
in VENDORPATH/laminas/laminas-db/src/Adapter/Driver/Pdo/Statement.php on line 212.
1 VENDORPATH/laminas/laminas-db/src/Adapter/Driver/Pdo/Statement.php(212): PDOStatement->execute()
2 VENDORPATH/grocery-crud/enterprise/src/GroceryCrud/Core/Model.php(563): Laminas\Db\Adapter\Driver\Pdo\Statement->execute()
3 VENDORPATH/grocery-crud/enterprise/src/GroceryCrud/Core/State/UpdateState.php(107): GroceryCrud\Core\Model->update()
4 VENDORPATH/grocery-crud/enterprise/src/GroceryCrud/Core/State/StateAbstract.php(1177): GroceryCrud\Core\State\UpdateState->GroceryCrud\Core\State\{closure}()
5 VENDORPATH/grocery-crud/enterprise/src/GroceryCrud/Core/State/StateAbstract.php(331): GroceryCrud\Core\State\StateAbstract->stateOperation()
6 VENDORPATH/grocery-crud/enterprise/src/GroceryCrud/Core/State/UpdateState.php(118): GroceryCrud\Core\State\StateAbstract->stateOperationWithCallbacks()
7 VENDORPATH/grocery-crud/enterprise/src/GroceryCrud/Core/GroceryCrud.php(2867): GroceryCrud\Core\State\UpdateState->render()
8 APPPATH/Controllers/Products.php(296): GroceryCrud\Core\GroceryCrud->render()
9 SYSTEMPATH/CodeIgniter.php(932): App\Controllers\Products->manage()
10 SYSTEMPATH/CodeIgniter.php(497): CodeIgniter\CodeIgniter->runController()
11 SYSTEMPATH/CodeIgniter.php(366): CodeIgniter\CodeIgniter->handleRequest()
12 FCPATH/index.php(67): CodeIgniter\CodeIgniter->run()
I checked the codepage in browser, is utf8 too.
This record was initially saved to db with CI active record and already truncated right to 255 utf8 symbols.
Are laminas-db adapter treat the utf8 content differently of CI-adapter? Can it be tuned anywhere with config options?
IMPORTANT:
same system, but with PHP7.4 - no error!
Thank you!