Answer the question
In order to leave comments, you need to log in
How to convert text from Windows-1252 encoding to UTF-8?
Does not work:
$metro = 'Ìåòðî Ïëàíåðíàÿ 474 ì';
$metro = iconv('CP1252', 'UTF-8', $metro);
$metro = 'Ìåòðî Ïëàíåðíàÿ 474 ì';
$metro = iconv('CP1252', 'CP1251', $metro);
$metro = iconv('CP1251', 'UTF-8', $metro);
Answer the question
In order to leave comments, you need to log in
you are making the same mistake as in previous parsing questions: working with already interpreted data instead of raw data.
when you write a line in a file, it acquires the encoding of this file, and not the original one, respectively, any conversion rituals are meaningless. $metro = 'Ìåòðî Ïëàíåðíàÿ 474 ì';
Save all your files in UTF-8 encoding. Specify UTF-8 encoding for the document. After these steps, you can start playing around with encoding conversion. mb_detect_encoding will help you find out what encoding the resulting text is in, in case something went wrong.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question