1

In my php page I read data from mysql by SQL query. In the output there are many words with special characters for example: à è ì ò ù ', but when output of query is displayed on the page, in all browsers, view a incorrect character �.

I try to use a replace function in the query

replace(field_name, 'à','à')

but not work.

If run the query in mysql, the output is correct.

How to resolve this problem?

Thanks

Frankie
  • 490
  • 8
  • 23

1 Answers1

0

Resolved with this code insiede tag <header> </header>

<?php header('Content-Type: text/html; charset=ISO-8859-1'); ?> 
<meta charset="utf-8">

Another way to resolve this is using MYSQL to update the encoding of the web application :

$mysqli = new mysqli("localhost", "user", "password", "db");
$mysqli->set_charset("utf8");

From Stefan Gehrig : https://stackoverflow.com/a/633826/4751603

Gangai Johann
  • 881
  • 12
  • 17
Frankie
  • 490
  • 8
  • 23
  • @Gangai Johann thanks. With this answare I have resolved the incorrect character problem inside an xls export. – Frankie Dec 24 '17 at 10:05