Skip to content

Social card cyrillic encoding bug #3099

@Zilborg

Description

@Zilborg

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

utf-8 encoding is missing missing (imho).
I think the trouble is missing encoding in ImageFont.truetype(self.font.get(700), 36, encoding="utf-8"), however, I couldn't to fix this.

Your source link.

Expected behaviour

Correct social card =)

Actual behaviour

Screenshot 2021-10-11 at 10 37 09

Russian title and description looks like squares.

Steps to reproduce

  1. Write title = 'Привет мир!' (Hello world in translation) and/or description = 'Привет мир!
  2. build
  3. https://cards-dev.twitter.com/validator

Package versions

Build with Github action.
I have the fork of insiders. There was last build with your hash commit (96e9a28f989abc498bc6f5ced4d0d061908c95ff commit link)

Configuration

# Configuration
theme:
  # Default values, taken from mkdocs_theme.yml
  language: en

# Plugins
plugins:
  - social

System information

I think, doesn't matter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions