Doom
Doom

Reputation: 1278

Json encode php long contents of array

i have a problem with json_encode with php, i use php 5.2.6 and i receive from server this data:

Array (… => Array ( [codIdenVerb] => 276122 [codAppe] => 778033 [codCorsoStud] => 00688 [descrizione] => PSICOLOGIA SOCIALE [crediti] => 9.0 [canale] => NESSUNA CANALIZZAZIONE [docente] => TONI ALESSANDRO [facolta] => SCIENZE POLITICHE, SOCIOLOGIA, COMUNICAZIONE [annoAcca] => 2012 [dataAppe] => 25/09/2012 .........

...

[note] => La prova scritta si svolgerà il giorno 10 settembre presso l'aula Magna a partire dalle ore 10.oo. La prova orale si svolgerà il giorno 25 settembre presso l'aula B14 a partire dalle ore 9.30. Si ricorda, inoltre, che la prenotazione su INFOSTUD per la data della prova ora è valida e necessaria per sostenere la prova scritta. 

..

[dataInizioPrenotazione] => 06/05/2012 [dataFinePrenotazione] => 30/08/2012 [questionario] => false [SiglaModuloDidattico] => 1010544 ) [7] => Array…)

for encode i use $json_string = json_encode($data);

but the part with [note] is cut whit: "note":"La prova scritta si svolger","..."
where is the problem? how can solve? Thanks!

Upvotes: 0

Views: 394

Answers (1)

Pekka
Pekka

Reputation: 449465

json_encode() expects incoming data to be UTF-8.

The data you are passing to it is probably not UTF-8.

Find out what encoding it is in, and adjust the input encoding or use e.g. iconv() to convert the data from your original encoding to UTF-8.

Upvotes: 2

Related Questions