Skip to main content

multi-byte character string decoder

Project description

**mbstrdecoder**

.. image:: https://badge.fury.io/py/mbstrdecoder.svg
:target: https://badge.fury.io/py/mbstrdecoder

.. image:: https://img.shields.io/pypi/pyversions/mbstrdecoder.svg
:target: https://pypi.org/project/mbstrdecoder

.. image:: https://img.shields.io/travis/thombashi/mbstrdecoder/master.svg?label=Linux/macOS
:target: https://travis-ci.org/thombashi/mbstrdecoder

.. image:: https://img.shields.io/appveyor/ci/thombashi/mbstrdecoder/master.svg?label=Windows
:target: https://ci.appveyor.com/project/thombashi/mbstrdecoder

.. image:: https://coveralls.io/repos/github/thombashi/mbstrdecoder/badge.svg?branch=master
:target: https://coveralls.io/github/thombashi/mbstrdecoder?branch=master


.. contents:: Table of contents
:backlinks: top
:local:


Summary
=======
Python library for multi-byte character string decoder.


Installation
============
::

pip install mbstrdecoder

or install all of the optional dependencies:

::

pip install mbstrdecoder[all]


Usage
=====

:Sample Code:
.. code:: python

from __future__ import print_function
from mbstrdecoder import MultiByteStrDecoder

encoded_multibyte_text = "マルチバイト文字".encode("utf-8")
decoder = MultiByteStrDecoder(encoded_multibyte_text)

print("encoded bytes: {}".format(encoded_multibyte_text))
print("unicode: {}".format(decoder.unicode_str))
print("codec: {}".format(decoder.codec))

:Output:
::

encoded bytes: b'\xe3\x83\x9e\xe3\x83\xab\xe3\x83\x81\xe3\x83\x90\xe3\x82\xa4\xe3\x83\x88\xe6\x96\x87\xe5\xad\x97'
unicode: マルチバイト文字
codec: utf_8


Dependencies
============
Python 2.7+ or 3.4+

Optional dependencies
-----------------
- `chardet <https://github.com/chardet/chardet>`__

Test dependencies
-----------------
- `pytest <https://pypi.org/project/pytest>`__
- `pytest-runner <https://github.com/pytest-dev/pytest-runner>`__
- `six <https://pypi.org/project/six/>`__
- `tox <https://pypi.org/project/tox>`__


Project details


Download files

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

Source Distribution

mbstrdecoder-0.6.0.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

mbstrdecoder-0.6.0-py2.py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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