Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python extension for dealing with validation and cleanup of UTF-8 strings
Python C
Tag: v0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
pyutf8
.gitignore
CHANGES.txt
LICENSE.txt
MANIFEST.in
README.rst
setup.py

README.rst

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
Something went wrong with that request. Please try again.