You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I encountered a problem with the encoding. Cyrillic does not display, how to collect data in the encoding 1251. tryed to use iconv, but Fatal error: Uncaught TypeError: iconv(): Argument #3 ($string) must be of type string, Embed\Extractor given
I haven't thoroughly tested this... but $detected = $encoding ?? mb_detect_encoding($html, NULL, true); seems to fix the problem.... The Windows-1251 Cyrillic shows up as well as UTF-8 Cyrillic no problem...
Hi @sakirsa, thanks for the report. The reported 4pda page declares windows-1251, and Cyrillic text renders correctly since #559. Guessing the encoding of pages that don't declare it is out of scope for a patch release. Feel free to reopen with a URL that still fails on the latest release (v4.6.0).
Activity
oscarotero commentedon Dec 4, 2022
Can I have an URL to reproduce this?
sakirsa commentedon Dec 4, 2022
https://4pda.to/2022/12/04/406834/sostoyalsya_reliz_clown_of_duty_parodii_na_call_of_duty/
sakirsa commentedon Dec 4, 2022
https://feedster.ru/emb.php to check if cloudflare blocks
parrycarry commentedon Dec 4, 2022
Oooo, I too would like to see a solution for this. The Cyrillic is completely voided when the page isn't UTF-8.
oscarotero commentedon Dec 4, 2022
Embed uses this parser to convert the HTML to DOMDocuments and deal with encoding issues.
The function is used here. I've forced the encoding in the second argument and it works fine:
So probably the automatic encoding detection of the parser doesn't work fine. Not sure how to fix it and I don't have much time to dig into this.
If anyone wants to work on a PR to fix it, it's very appreciated.
parrycarry commentedon Dec 4, 2022
I haven't thoroughly tested this... but
$detected = $encoding ?? mb_detect_encoding($html, NULL, true);seems to fix the problem.... The Windows-1251 Cyrillic shows up as well as UTF-8 Cyrillic no problem...Vitorinox commentedon Oct 31, 2026
Hi @sakirsa, thanks for the report. The reported 4pda page declares windows-1251, and Cyrillic text renders correctly since #559. Guessing the encoding of pages that don't declare it is out of scope for a patch release. Feel free to reopen with a URL that still fails on the latest release (v4.6.0).