Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 15 lines (12 sloc) 0.485 kb
de9819a9 »
2010-03-13 use a single reStructuredText README.rst
1 pyutf8 provides tools to efficiently deal with the validation
2 and cleanup of UTF-8 strings. The primary use case is "garbage in utf-8 out".
3
4 Usage::
5
cf3745be »
2010-03-13 intent-region
6 >>> from pyutf8 import valid_utf8_bytes
7 >>> SNOWMAN = u'\N{SNOWMAN}'
8 >>> SNOWMAN_BYTES = SNOWMAN.encode('utf-8')
9 >>> valid_utf8_bytes(SNOWMAN) == SNOWMAN_BYTES
10 True
11 >>> valid_utf8_bytes(SNOWMAN_BYTES) == SNOWMAN_BYTES
12 True
13 >>> valid_utf8_bytes('\xff' + SNOWMAN_BYTES + '\xff') == SNOWMAN_BYTES
14 True
Something went wrong with that request. Please try again.