This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

UTF-7 encoded unsigned integer

Project Description

Encoder/decoder of an UTF-7 encoded unsigned integer.

>>> utf7.pack_bytes(65535)
b'\xff\xff\x03'
>>> utf7.unpack_bytes(b'\xff\xff\x03')
65535

UTF-7 uint is used for BinaryWriter.Write(String) in Microsoft .NET Framework. Here’s an example of ping-pong between Python server and C# client:

while not socket.closed:
    # recv ping
    ping_size = utf7.unpack_socket(socket)
    ping_data = socket.recv(ping_size)
    assert ping_data == b'ping'
    # send pong
    pong_data = b'pong'
    pong_size = len(pong_data)
    utf7.pack_socket(pong_size, socket)
    socket.send(pong_data)

You can also use _utf7 written in C to take high-speed:

import _utf7 as utf7
Release History

Release History

This version
History Node

0.9.3

History Node

0.9.2

History Node

0.9.1

History Node

0.9.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
utf7-0.9.3.tar.gz (20.6 kB) Copy SHA256 Checksum SHA256 Source Aug 23, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting