How to solve the issue with encoding in php?

Good day, rarely use php, but when I always get into trouble - problem with encoding. Question already asked on this site got the answer and all the help. But now even that didn't work.
The point is, make a request, in response to receiving windows-1251, although it should be UTF-8
let form = "Example"
 let formData = {
form
}
$.ajax({
 url: "_ajax.php",
 type: "POST",
 data: formData,
success:function(data){}
})

and, accordingly,
<?php
header('Content-Type: text/html; charset=utf-8');
mb_internal_encoding("UTF-8");
ini_set('display_errors', 1);
$html=$_REQUEST['form'];
echo $html;
?>

in. htaccess put all what you need :

AddDefaultCharset UTF-8
php_value default_charset "utf-8"

also I tried the options in php :

$content = iconv("windows-1251", "utf-8", $html); //Change the encoding


$content = rawurlencode($html)
March 19th 20 at 08:59
1 answer
March 19th 20 at 09:01
The problem can be solved banal opening the php file in notepad++ and re-save in the right encoding

Find more questions by tags PHP