Answer the question
In order to leave comments, you need to log in
Why is the site in utf-8, but letters come in windows-1251?
The page of the site, on which the form for sending text in utf-8. The text of the letter comes to the mail (local OpenServera) in the form "Name: R'PIRµRґРёС‚Рµ СЃРІРѕРµ РёРјСЏ.." That is, the part that is formed by the PHP code arrives normally, and the part that is taken from the form is corrupted.
Moreover, if you set the page encoding to ANSI or windows-1251, then the entire page turns into crocodile characters, and letters arrive in their normal form.
How to be?
ps. Perhaps I came across the right solutions, but I'm already confused and stupid.
Answer the question
In order to leave comments, you need to log in
Write the encoding in the header of the letter:
$headers = "Content-type: text/html; charset=utf-8\r\n";
check the encoding. UTF-8 must be specified on the page and files must also be in utf-8.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question