A
A
Alexander Pankov2018-03-21 22:49:09
PHP
Alexander Pankov, 2018-03-21 22:49:09

How to solve php encoding problem?

I am writing a parser of goods from an XML file,
if you follow the debugging in phpStorm, then everything is ok, there are Russian letters,
5ab2b6641f0cb136854644.png
but when I output (var_dump) to the browser, I see the following
5ab2b6a81207a299450339.png
krakozyabry ... Lebedev's
decoder says that CP1251 should be translated into UTF-8 and everything will be readable again, but I did it through iconv and still see crooks, but others.
maybe I just need to send some kind of header to the browser, tell me why this is happening and how to fix it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sklyarov, 2018-03-21
@PankovAlxndr

header('Content-type: text/html; charset=utf-8');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question