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

Link preview fails to decode UTF-8. #29996

Open
dhoepfl opened this issue Apr 19, 2024 · 1 comment
Open

Link preview fails to decode UTF-8. #29996

dhoepfl opened this issue Apr 19, 2024 · 1 comment
Labels
area/web interface Related to the Mastodon web interface bug Something isn't working status/to triage This issue needs to be triaged

Comments

@dhoepfl
Copy link

dhoepfl commented Apr 19, 2024

Steps to reproduce the problem

See this post.

The link preview says “Lüneburg Aktuell · Apr 8” instead of “Lüneburg Aktuell · Apr 8”.

Expected behaviour

Incorrect encoding in one tag should not break others.

Actual behaviour

See above: “Lüneburg” instead of “Lüneburg”.

Detailed description

I suspect the incorrectly truncated UTF-8 sequence at the end of the og:description tag triggers this error: <meta property="og:description" content="Aufruf gegen den Landesparteitag der AfD Niedersachsen am 20. April in Unterlüß Gemeinsam gegen rechts – für eine vielfältige Gesellschaft! Die niedersächsische AfD h�...">

Mastodon instance

layer8.space, and on original page on norden.social

Mastodon version

v4.2.8

Browser name and version

Firefox 125.0.1

Operating system

Windows 10

Technical details

No response

@dhoepfl dhoepfl added area/web interface Related to the Mastodon web interface bug Something isn't working status/to triage This issue needs to be triaged labels Apr 19, 2024
@PuercoPop
Copy link

PuercoPop commented Apr 20, 2024

Reading the code, each tag is processed independently

def provider_name
html_entities.decode(structured_data&.publisher_name || opengraph_tag('og:site_name'))
end

I checked the spec file and there is no data using utf8. Trying to reproduce locally would involve updating the spec

<meta property="og:site_name" content="Pet News">


The linked toot's site has the following OpenGran site_name tag:
<meta property="og:site_name" content="Lüneburg Aktuell">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web interface Related to the Mastodon web interface bug Something isn't working status/to triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants