Project

General

Profile

Actions

Bug #68582

closed

json_encode-Problem

Added by Chili no-lastname-given over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Logging
Target version:
-
Start date:
2015-07-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

I get this message in my TYPO3-Log

Core: Error handler (BE): PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in /.../typo3_src/typo3_src-6.2.14/typo3/sysext/core/Classes/Log/Writer/FileWriter.php line 125

I don't know what causes this error and how to fix it.
I set this in my configuration:

[SYS][UTF8filesystem] = 1
[SYS][systemLocale] = de_DE.UTF-8
and of course MySQL-DB is UTF-8


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #75403: json_encode-ProblemClosed2016-04-05

Actions
Actions #1

Updated by Chili no-lastname-given over 8 years ago

Hi,

I detect why this error-message appears:

In line 125 in file FileWriter.php is

$data = '- ' . json_encode($recordData);

Some of the items in array $recordData seem not to be utf-8.
When I write this before the json_encode, I don't get the error-message:

array_walk_recursive($recordData, function(&$item, $key){
if(!mb_detect_encoding($item, 'utf-8', true)){
$item = utf8_encode($item);
}
});

Is this the solution or is there another way without editing this file of the core by my own??

Actions #2

Updated by Alexander Opitz over 8 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (6.2.14)

Can you check where the data with non UTF8 chars comes from?

Actions #3

Updated by Wouter Wolters over 8 years ago

Any update here?

Actions #4

Updated by Alexander Opitz about 8 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions #5

Updated by Chili no-lastname-given about 8 years ago

I updated from 6.2.14 to 6.2.19 and the error still appears and I can still fix it with the lines above.
No, I don't know where the non UTF8 chars come from - how can I check that?

Actions

Also available in: Atom PDF