Project

General

Profile

Actions

Bug #75403

closed

json_encode-Problem

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

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-04-05
Due date:
% Done:

0%

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

Description

I updated from 6.2.14 to 6.2.19 and the error still appears
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

and I can still fix it with:

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

No, I don't know where the non UTF8 chars come from - how can I check that?

This error is related to https://forge.typo3.org/issues/68582


Files

recordData.log (111 Bytes) recordData.log Chili no-lastname-given, 2016-04-08 08:12

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #68582: json_encode-ProblemClosed2015-07-28

Actions
Actions #1

Updated by Wouter Wolters over 8 years ago

  • Status changed from New to Needs Feedback

What is the actual data that is being logged, can you figure that out?

Actions #2

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

To be honest: I can't.
I had a look in the error and access log of my server and there is no error and no warning in the time the error appears in my typo3.log.

Actions #3

Updated by Wouter Wolters over 8 years ago

Without more information we can't help you with solving your issue.
We really need more information were this data comes from. Can you debug the code at this point and print out that data?

Actions #4

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

Okay, I was able to write the content of the array $recordData in a file and the error occurs whenever an error is written into the log.
So I tried a login with wrong parameters to force Typo3 to write into the log and the values of the array where (the second one is the IP adress):

wrongadmin
123.456.78.9 ()

2

I could not print the array out. When I write something like echo, var_dump or print in the line above (FileWriter.php, above $data = '- ' . json_encode($recordData);) then nothing ist printed out, I'm sorry.

Actions #5

Updated by Andreas Kienast over 8 years ago

You may write that stuff into a file, e.g: file_put_contents(PATH_site . '/typo3temp/recordData.log', print_r($recordData, true));

This writes the output of print_r() into typo3temp/recordData.log

Actions #6

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

I attached the file with the content of $recordData.

I asked myself if this error occurs because of php 5.4 .
I don't have the permission to update the php version, so I'm not able to test my assumption. Perhaps someone else can figure out if it's the version?

Actions #7

Updated by Wouter Wolters over 8 years ago

This does not look the data that gives you the error. Please log for a while and see if there are any special characters in there.

Actions #8

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

I did what you said but I still got the same data in the file. Perhaps it's something special in the configuration of the server. We'll use Typo3 7 at the end of the year. Perhaps the problem disappears ;) and in the meanwhile I can fix it with the workaround above.

Actions #9

Updated by Wouter Wolters over 8 years ago

  • Status changed from Needs Feedback to Closed

I'm closing this issue. I hope the problem is solved for you when you start using 7.6.
There is not enough information to reproduce it on my system. Hope that is ok with you.

Actions

Also available in: Atom PDF