Skip to main content

pyutf8 provides tools to efficiently deal with the validation and cleanup of UTF-8 strings. The primary use case is “garbage in utf-8 out”.

Usage:

>>> from pyutf8 import valid_utf8_bytes
>>> SNOWMAN = u'\N{SNOWMAN}'
>>> SNOWMAN_BYTES = SNOWMAN.encode('utf-8')
>>> valid_utf8_bytes(SNOWMAN) == SNOWMAN_BYTES
True
>>> valid_utf8_bytes(SNOWMAN_BYTES) == SNOWMAN_BYTES
True
>>> valid_utf8_bytes('\xff' + SNOWMAN_BYTES + '\xff') == SNOWMAN_BYTES
True

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyutf8-0.1.tar.gz (9.6 kB view details)

Uploaded Source

File details

Details for the file pyutf8-0.1.tar.gz.

File metadata

  • Download URL: pyutf8-0.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyutf8-0.1.tar.gz
Algorithm Hash digest
SHA256 2bbe4a23a2e922d97b78d783382e46318aad13e53bda198d5cccda94a96aeee1
MD5 8dcb97152ac6bc5625f3b75007be8502
BLAKE2b-256 38b71747b421ccb438be2ba094fd27e71c52da10567546203bfdb6e2922087df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page