-----------
**Tired of Python's `UnicodeDeocodeError, ascii codec can't decode?`**
Here's how to fix it, once and for all.
1. `$ pip install utf8forgood`
2. in your main program, add
```
import utf8forgood
```
If you like it, make the change permanent in your sitecustomize.py:
```
# /path/to/site-packages/sitecustomize.py
import utf8forgood
```
To find the path to `sitecustomize.py`, run `python -m site` or read up on
the [site-specific configuration hook][8].
Why?
----
In general to the above, the fastest remedy is probably trying out the following, in this order:
1. Use `PYTONIOENCODING=UTF-8 python /path/to/program.py`
2. Use the [`sys.setdefaultencoding`][1] hack. That is, unless you care [what others say][2]
3. Write your own import function to [convert data][3] appropriately, which is generally the [recommended way][4].
After [much consideration][7] and trying option 3 I finally concluded that option 2
is the straight forward way and usually [just does what you want][5], on the off-chance of [getting yourself in trouble][6].
[1]: http://stackoverflow.com/a/17628350/890242
[2]: http://stackoverflow.com/questions/28657010/dangers-of-sys-setdefaultencodingutf-8
[3]: http://stackoverflow.com/a/28760303/890242
[4]: http://stackoverflow.com/a/34378962/890242
[5]: http://stackoverflow.com/a/29558302/890242
[6]: http://stackoverflow.com/a/29561747/890242
[7]: http://stackoverflow.com/a/27745947/890242
[8]: https://docs.python.org/2/library/site.html
Metadata
Release files for utf8forgood 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| utf8forgood-0.1.4.tar.gz | 2.0 kB | Without provenance | Details for utf8forgood-0.1.4.tar.gz |
Release files / utf8forgood-0.1.4.tar.gz
| Download URL | utf8forgood-0.1.4.tar.gz |
|---|---|
| Size | 2.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6542c088ead7f3602c3e0a565891565d3aab5d479365679c7d51aac2590dbde7
|
|
BLAKE2b-256 checksum How to use checksums |
10e3a19a4f603f4dc844730cd6bc7091ee6ba7f13a31aa85f8a503b8c6f7ca5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for utf8forgood 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.