https://github.com/thombashi/mbstrdecoder
Python library for multi-byte character string decoder.
https://github.com/thombashi/mbstrdecoder
decoder multi-byte-string python-library
Last synced: about 1 month ago
JSON representation
Python library for multi-byte character string decoder.
- Host: GitHub
- URL: https://github.com/thombashi/mbstrdecoder
- Owner: thombashi
- License: mit
- Created: 2016-12-10T04:34:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-01-18T10:06:23.000Z (5 months ago)
- Last Synced: 2025-04-27T08:02:34.124Z (about 2 months ago)
- Topics: decoder, multi-byte-string, python-library
- Language: Python
- Size: 145 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. contents:: **mbstrdecoder**
:backlinks: top
:local:Summary
=======
`mbstrdecoder `__ is a Python library for multi-byte character string decoder... image:: https://badge.fury.io/py/mbstrdecoder.svg
:target: https://badge.fury.io/py/mbstrdecoder
:alt: PyPI package version.. image:: https://img.shields.io/pypi/pyversions/mbstrdecoder.svg
:target: https://pypi.org/project/mbstrdecoder
:alt: Supported Python versions.. image:: https://img.shields.io/pypi/implementation/mbstrdecoder.svg
:target: https://pypi.org/project/mbstrdecoder
:alt: Supported Python implementations.. image:: https://github.com/thombashi/mbstrdecoder/actions/workflows/ci.yml/badge.svg
:target: https://github.com/thombashi/mbstrdecoder/actions/workflows/ci.yml
:alt: CI status of Linux/macOS/Windows.. image:: https://coveralls.io/repos/github/thombashi/mbstrdecoder/badge.svg?branch=master
:target: https://coveralls.io/github/thombashi/mbstrdecoder?branch=master
:alt: Test coverage.. image:: https://github.com/thombashi/mbstrdecoder/actions/workflows/github-code-scanning/codeql/badge.svg
:target: https://github.com/thombashi/mbstrdecoder/actions/workflows/github-code-scanning/codeql
:alt: CodeQLInstallation
============Install from PyPI
------------------------------
::pip install mbstrdecoder
Install from PPA (for Ubuntu)
------------------------------
::sudo add-apt-repository ppa:thombashi/ppa
sudo apt update
sudo apt install python3-mbstrdecoderUsage
=====:Sample Code:
.. code:: pythonfrom 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_8Dependencies
============
- Python 3.9+
- `Python package dependencies (automatically installed) `__