Skip to content

Djhtml fails to complete due to old default encoding on windows #122

Description

@jeriox

When running djhtml on Windows 11 for my project, it fails with Error: 'charmap' codec can't decode byte 0x8f in position 622: character maps to <undefined>. According to various sources (e.g. https://stackoverflow.com/a/68650013) this is due to Windows using an outdated encoding (windows-1252) by default if no encoding is specified when opening the file. This encoding fails to read utf-8 characters. Adding encoding="utf-8" to the open() call in https://github.com/rtts/djhtml/blob/main/djhtml/__main__.py#L53 solves the problem for me.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions