R
R
rocket2014-11-05 14:00:16
PHP
rocket, 2014-11-05 14:00:16

Why is utf8 encoding byte lost in php-fpm?

There is a web server with Nginx and php-fpm on board.
usecase: We create a text file on the web server with content in Cyrillic in utf-8 encoding. If this file is given the .html extension, then Russian characters are normally displayed in the browser. If you rename it to .php, then Russian characters turn into "question questions" (????? ?? ????).
At the same time, if in the .php file the text is displayed not as a spool, but through <? echo "cyrillic"; ?> then the text is not "wrapped".
Tell me what could be the problem? Where can one byte of encoding be lost?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
KorsaR-ZN, 2014-11-05
@rocket

What encoding are the files in? I'm assuming it's not UTF-8, or UTF-8 BOM.
Convert files to UTF-8 without BOM, for example using Notepad++

F
FanatPHP, 2014-11-05
@FanatPHP

F12 - Network - F5 - first line - Headers - look for the Content-Type header and wonder what is written there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question