Ho risolto, pare, inserendo htmlentities($messaggioutente, ENT_QUOTES, "UTF-8") nelle variabili in php..