Skip to content

error: charset malformed JSON... this happen with columns fields from db with specials characters... any fix? #8

@rapgithub

Description

@rapgithub

I have a table with a column text with French and Spanish characters and the JSON returned from the API gives me error

Fatal error: Uncaught InvalidArgumentException: Unable to encode data to JSON in Zend\Diactoros\Response\JsonResponse: Malformed UTF-8 characters, possibly incorrectly encoded in /Applications/MAMP/htdocs/www/cpanel_tripsbro/vendor/zendframework/zend-diactoros/src/Response/JsonResponse.php:164 Stack trace: #0 

I think the issue it is the charset problem... my table is utf-8 charset in the db and header and html charset is ok but the issue it is from the API returning malformed Json when the column has accents in the field to show...

is there a way to set charset when using the line below?
$db = new \atk4\data\Persistence_SQL connection here?

or where?

thanks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions