Bug #90372
closedError in JsonResponse when special character is the 20th character in a string
100%
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
Updated by Georg Ringer almost 5 years ago
slack discussion: https://typo3.slack.com/archives/C025BQLFA/p1581617109392200
Updated by Georg Ringer almost 5 years ago
- Status changed from New to Needs Feedback
can you please give some hints how to reproduce that. thanks!
Updated by Gerrit Code Review almost 5 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63255
Updated by Gerrit Code Review almost 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63255
Updated by Georg Ringer almost 5 years ago
test extension added. after install, go to any page properties and watch the xhr request, one for codemirror fails
Updated by Gerrit Code Review almost 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63227
Updated by Georg Ringer almost 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 425c911e9ce7c5fe3f54e01997b1cc3420cda3e5.