Skip to content

Explicitly specify the encoding parameter value of calendar.HTMLCalendar as 'utf-8' #135001

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

Open
Wulian233 opened this issue Jun 1, 2025 · 0 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@Wulian233
Copy link
Contributor

Wulian233 commented Jun 1, 2025

Feature or enhancement

Proposal:

Currently, the calendar.HTMLCalendar.formatyearpage method is used to generate an html of a calendar. encoding parameter defaults to the sys.getdefaultencoding(), but it always returns "utf-8". (PEP 686 – Making UTF-8 Mode default ) I propose changing this default to 'utf-8', this makes it clearer

In a similar vein, the difflib.HtmlDiff also outputs HTML with UTF-8 encoding by default.

Linked PRs

@Wulian233 Wulian233 added the type-feature A feature request or enhancement label Jun 1, 2025
@Wulian233 Wulian233 changed the title Change the default *encoding* of calendar.HTMLCalendar to UTF-8 Change the default encoding parameter value of calendar.HTMLCalendar to utf-8 Jun 1, 2025
@picnixz picnixz added the stdlib Python modules in the Lib dir label Jun 1, 2025
@Wulian233 Wulian233 changed the title Change the default encoding parameter value of calendar.HTMLCalendar to utf-8 Explicitly specify the encoding parameter value of calendar.HTMLCalendar as 'utf-8' Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy