Skip to main content
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.

—Zen of Python

This small module implements a bad idea: making default encoding explicitly scoped:

>>> with encoding_context('euc-kr'):
...     str(u'\ud55c\uae00')
...
'\xc7\xd1\xb1\xdb'

Of course it has several shortcomings, and the most critical one is: using it within thread, threading, greenlet, tasklet, etc probably breaks its scoping. If Python had dynamic scoping and default encoding was defined as dynamically scoped variable, we might have more convenient way to code between Unicode–byte strings.

Metadata

Release files for encodingcontext 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for encodingcontext 0.9.0
File Size Uploaded
encodingcontext-0.9.0.tar.gz 1.7 kB Details

Release files / encodingcontext-0.9.0.tar.gz

Download URL encodingcontext-0.9.0.tar.gz
Size 1.7 kB
Tags Source
SHA-256 checksum
How to use checksums
404a963c376817a158b41a6e0353a1d73823619b60cbf6a6f9bfb708fd9ef9f4
BLAKE2b-256 checksum
How to use checksums
a58e88c6008103c3b79909cc44353ea015d608e5537ec11d9eaa6d62995ba08f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.9.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page