risolto tutto in fase di output dei dati con
htmlentities($riga [1],ENT_QUOTES,'UTF-8')