I'm parsing a page using php cURL and slicing data using DOMDocument() function. Parsed page has "UTF-8" encoding. Then i write data to database. But instead of
музыка
it is writing ASCII codes like this:
Музыка
I've tried iconv(), mb_convert_encoding(), utf8_encode, but still get the same. strlen() return the length of the coded string.
How to encode this to normal text?
<?php
$string ="Музыка";
echo html_entity_decode($string, ENT_NOQUOTES, 'UTF-8');
prints:
Музыка
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.