Bonjour à tous,

J'ai ce problème d'accents qui me gène tout le temps, j'ai cherché j'ai essayé trop de trucs mais toujours le même prob.

Voila mon petit code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
	include ('connexion/connexion.php');
	header("Content-type: application/vnd.ms-excel; charset=UTF-16LE");
	header("Content-Transfer-Encoding: text/csv\n"); 
	header("Content-Disposition: attachment; filename=Export_". date("Y-m-d-h:m:s").".csv");
	header("Pragma: no-cache");
	header("Expires: 0");
 
	$dt=$_REQUEST['dt'];
	$tp=$_REQUEST['tp'];
 
    $show=$conn->query("SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_NAME`='$tp' ");
    $i = 0;
    $csv_output="";
	if (mysqli_num_rows($show) > 0)
	{
		while ($row = mysqli_fetch_array($show))
		{
			$csv_output .=$row[0].";";
			$i++;
		}
	}
 
 
 
	$csv_output .= "\n";
 
	$sql =$conn->query("SELECT * FROM `$tp` WHERE `date_import` LIKE '$dt%'");
   while ($rowr = mysqli_fetch_row($sql))
	{
		for ($j=0;$j<$i;$j++)
		{
			$csv_output .= $rowr[$j].";";
		}
 
		$csv_output .= "\n";
	}
 
	echo chr(255).chr(254).mb_convert_encoding( $csv_output, 'UTF-16LE', 'UTF-8');
 
 
    mysqli_close($conn);
 
?>
J'ai essayé htmlspecialchars_decode($csv_output); et bien d'autres fonction et le résultat ça se varie entre les symboles chinois où les ??? ou bien le vide

Merci d'avence