Project

General

Profile

Actions

Bug #90372

closed

Error in JsonResponse when special character is the 20th character in a string

Added by Raphael Zschorsch almost 5 years ago. Updated over 4 years ago.

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

test.zip (7.08 KB) test.zip Georg Ringer, 2020-02-15 16:06
Actions #2

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!

Actions #3

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

Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

Updated by Georg Ringer almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF