C
C
Cyril2019-05-27 15:03:57
PHP
Cyril, 2019-05-27 15:03:57

How to solve encoding problem when using phpQuery?

I get through the file_get_contentspage, the page is exactly in utf8, the meta tag with the encoding is also in order. But for the place of the Russian text, I have this:

XVR видеоÑегиÑÑÑаÑоÑ, пенÑа-бÑид. ÐолиÑеÑÑво видеовÑодов: 32 канала; ÐоддеÑживаемÑе видеоÑигналÑ: Ðналог, HDCVI, TVI, AHD, IP (32 камеÑÑ, до 5Ðп); РазÑеÑение запиÑи 1080p / 720p / 960H / D1 / HD1 / 2CIF / CIF; СкоÑоÑÑÑ Ð·Ð°Ð¿Ð¸Ñи: 15 кадÑов/Ñ - 1080p, 25 кадÑов/Ñ - 1080N/720p; ÐидеоÑжаÑие/аÑдиоÑжаÑие: H.264/H.264+; ÐÑдиовÑодÑ/вÑÑодÑ: 1/1 , RCA; ÐидеовÑÑодÑ:  1-HDMI, 1-VGA;  РоÐ-поÑÑÑ: неÑ;  ÐоддеÑживаемое колиÑеÑÑво жеÑÑÐºÐ¸Ñ Ð´Ð¸Ñков:  2 HDD до 8Tb(каждÑй);  ÐнÑеÑÑейÑÑ: 1-USB2.0, 1-USB3.0, RS-485; ÐиÑание: DC12V; ÐоÑÑеблÑемÑй Ñок: 4Ð; СеÑевÑе ÑÑнкÑии: HTTP, IPv4/IPv6,

I also forced the encoding
phpQuery::newDocumentHTML(getHtml($page), $charset="utf-8");
The result is the same.
If you save the file and open it with a text editor, then everything is in order inside with Russian characters, but if you start parsing this file, then there will be the same problem.
If you go to sublime text and resave in utf-8 with BOM, then the file is parsed with normal Russian characters, this does not work in notepad ++.
Added to the beginning of the content and the file "\xEF\xBB\xBF"- again, it did nothing.
I do not know what to do, how to solve this problem?

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