S
S
Scuba2021-02-25 16:05:02
PHP
Scuba, 2021-02-25 16:05:02

Can't beat encoding: question marks in Parserdown (markdown parser), how to remove?

I want to implement markdown on my website.
I take the text from $_POST, and put it into the Parserdown library ( https://github.com/erusev/parsedown )

It turns out like this:
60379f7e257e1415564282.png

Signs change to "Psi", questions in a rhombus, or some letters completely disappear.
I check the encoding before passing it to the parser - UTF-8.
I check after - UTF-8.

Everything that can be already registered, does not help.

In PHP:

setlocale(LC_ALL, 'ru_RU.utf8');
header('Content-Type: text/html; charset=utf-8', true);
mb_internal_encoding('UTF-8');


In .htaccess:
AddDefaultCharset UTF-8

In HTML: In the hosting settings, UTF-8 is also everywhere. At the same time, in the "Demo" of this plugin, my text is processed normally, that is, there is a problem on my site. In a text editor (I have Sublime) also UTF-8. The only thing that helped solve this problem was: header('Content-Type: text/html; charset=Windows-1251', true); and recode in a text editor in Win-1251. But not to resave the entire site?
<meta charset="utf-8">


Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question