Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyrillic text appears scrambled #18

Open
kerpi4 opened this issue Feb 29, 2024 · 1 comment
Open

Cyrillic text appears scrambled #18

kerpi4 opened this issue Feb 29, 2024 · 1 comment

Comments

@kerpi4
Copy link

kerpi4 commented Feb 29, 2024

See the screenshot below.

Did a little digging and fixed it by adding meta tag to specify encoding where the new document is created in extractReal() from Content.php.

private function extractReal(): void
    {
        $dom = new \DomDocument('1.0', 'UTF-8');
        $content = htmlspecialchars_decode(htmlentities(html_entity_decode(
$this->raw)));
        $dom->loadHTML(
            "<meta http-equiv='Content-Type' content='charset=utf-8' /><div
>$content</div>",
            LIBXML_NOERROR
        );
...

Not sure how good of a solution this is. So if you wanna look into it I'd be grateful.

Screenshot_2024-02-29-12-51-22

@aledeg
Copy link
Owner

aledeg commented Mar 20, 2024

Thank you for that.
I know there are some problem with character encoding. At the same time, I don't spend so much time on this extension since Reddit broke how it was working. There is some rate limiting and they broke the content. It's hard to find some motivation to redo the work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants