encodingcontext-0.9.0
توضیحات
A bad idea about the default encoding
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | encodingcontext-0.9.0 |
| نام | encodingcontext |
| نسخه کتابخانه | 0.9.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Hong Minhee |
| ایمیل نویسنده | minhee@dahlia.kr |
| آدرس صفحه اصلی | https://github.com/dahlia/encodingcontext |
| آدرس اینترنتی | https://pypi.org/project/encodingcontext/ |
| مجوز | MIT License |
``encodingcontext`` --- A bad idea about the default encoding
=============================================================
| 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:
.. code-block:: pycon
>>> 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.
نحوه نصب
نصب پکیج whl encodingcontext-0.9.0:
pip install encodingcontext-0.9.0.whl
نصب پکیج tar.gz encodingcontext-0.9.0:
pip install encodingcontext-0.9.0.tar.gz