I solved my problems with charsets in this way:
1. Before composing the HTML page send the header, in this way:
header("Content-type: text/html; charset=utf-8");
2. Put in HTML page the following:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html"; charset="utf-8">
that's all.