Actions
Bug #90372
closedError in JsonResponse when special character is the 20th character in a string
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2020-02-14
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
When defining something like this in TypoScript:
city = Steinau an der Straße
where the special character is the 20th character, I get the following error in Log module:
Unable to encode data to JSON in TYPO3\CMS\Core\Http\JsonResponse: Malformed UTF-8 characters, possibly incorrectly encoded
This happens, because the strings get cropped after 20 characters, so the ß is malformed and TYPO3 outputs the error.
A solution (found in Slack Channel), which is working in my use case, would be to add JSON_INVALID_UTF8_SUBSTITUTE to the DEFAULT_JSON_FLAGS in JsonResponse.php
Database and everything is set to utf8mb4. TYPO3 Version 9.5.13.
Files
Actions