PHP Classes

json_encode needs UTF-8

Recommend this page to a friend!

      PHP Web Site Compare Files  >  All threads  >  json_encode needs UTF-8  >  (Un) Subscribe thread alerts  
Subject:json_encode needs UTF-8
Summary:In file_list, $details filename must be UTF-8 encoded
Messages:1
Author:Gilbert BENOIT
Date:2016-08-17 22:03:20
 

  1. json_encode needs UTF-8   Reply   Report abuse  
Picture of Gilbert BENOIT Gilbert BENOIT - 2016-08-17 22:03:20
Hi,

For me, it doesn't work without encoding the filenames :

$details[$aCount]['filename'] = utf8_encode(str_replace('../../', '', $files[$i]));

It could be useful to test json_last_error before echoing json string. The sites always match if file_list echoed null.

Question : why this test on $fileok in globRecursive ?

Thanks,