I have MacCyrillic-encoded text, for example:
<f>–¢–µ–Ї—Г—Й–Є–є —Б—З–µ—В</f>
How can I convert it to UTF-8 in PHP?
I'm getting these errors:
iconv(): Wrong charset, conversion from x-mac-cyrillic to UTF-8 is not allowed. iconv(): Wrong charset, conversion from CP10007 to `UTF-8' is not allowed iconv(): Wrong charset, conversion from CP-10007 to UTF-8 is not allowed
I've also tried this:
<?php
$text = '<f>–¢–µ–Ї—Г—Й–Є–є —Б—З–µ—В</f>';
echo iconv('macintosh', 'UTF-8', $text) . PHP_EOL;
echo iconv('windows-1251', 'UTF-8', convert_cyr_string($text, 'm', 'w'));
But it doesn't work either. Please, help me. Thank you.