mutf8
Fast MUTF-8 encoder & decoder
What it is and what it does
mutf8 is a codec library for Modified UTF-8, the variant used by the Java Virtual Machine for encoding strings in class files, JNI interfaces, and object serialization. It provides both a C extension and a pure-Python fallback, allowing developers to encode Unicode strings to MUTF-8 bytes and decode MUTF-8 bytes back to Unicode. The library does not register itself as a global codec, keeping imports side-effect-free.
The C extension is significantly faster than the pure-Python version, with speedups ranging from around 10× on tiny strings to over 1000× on large ASCII payloads. The package supports Python 3.9 through 3.14 and is distributed as prebuilt wheels for most platforms, minimizing installation friction.
Use it for:
- Parse and manipulate Java .class files by decoding MUTF-8 strings embedded in the bytecode.
- Handle string data passed through JNI (Java Native Interface) boundaries in Python-Java interoperability.
- Deserialize objects exported by Java's object serialization format, which uses MUTF-8 for string encoding.
- Build tools or analyzers that work with JVM bytecode or class file metadata.
- Implement protocol handlers that communicate with Java systems using MUTF-8-encoded strings.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes MUTF-8 (Modified UTF-8), a variant used in Java class files and JNI, with both C and pure-Python implementations.
Yes, if you work with JVM artifacts or JNI. The package is actively maintained, has no known vulnerabilities, and offers both performance (C extension) and portability (pure-Python fallback). Install friction is moderate but manageable via prebuilt wheels. MIT license carries no restrictions.
Install
mutf8 on PyPI
pip
pip install mutf8uv
uv add mutf8poetry
poetry add mutf8Installing mutf8
Before you install
Medium install friction due to C extension compilation, but prebuilt wheels are available for Python 3.9–3.14 on common platforms (macOS, Linux, Windows). Package is actively maintained with a recent release.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
pip install mutf8
from mutf8 import encode_modified_utf8, decode_modified_utf8
unicode = decode_modified_utf8(b'\xED\xA1\x80\xED\xB0\x80')
bytes_out = encode_modified_utf8(unicode)
Requires Python 3.9 or later; C extension is optional and falls back to pure-Python if compilation fails.
Verify before relying
- Whether the pure-Python fallback is automatically selected on all platforms where C compilation is unavailable.
- Performance characteristics of the pure-Python implementation on real-world payloads outside the benchmark scenarios.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 35 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,078,907/month — #3,309 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mutf8-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl; mutf8-1.1.0-cp310-cp310-macosx_11_0_arm64.whl; mutf8-1.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; mutf8-1.1.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; mutf8-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl; mutf8-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl; mutf8-1.1.0-cp310-cp310-win32.whl; mutf8-1.1.0-cp310-cp310-win_amd64.whl; mutf8-1.1.0-cp311-cp311-macosx_11_0_arm64.whl; mutf8-1.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; mutf8-1.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; mutf8-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl; mutf8-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl; mutf8-1.1.0-cp311-cp311-win32.whl; mutf8-1.1.0-cp311-cp311-win_amd64.whl; mutf8-1.1.0-cp312-cp312-macosx_11_0_arm64.whl; mutf8-1.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; mutf8-1.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; mutf8-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl; mutf8-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
Keywords: mutf-8, cesu-8, jvm
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
rtfunicodeEncodes Unicode strings to RTF 1.5 command…
permissive · top 15,000 on PyPI
mbstrdecoderDecodes multi-byte character strings by…
permissive · top 5,000 on PyPI
anyasciiConverts Unicode text to ASCII-only equivalents…
permissive · top 5,000 on PyPI
base2048Encodes and decodes binary data using Base2048,…
permissive · top 15,000 on PyPI
asn1Encodes and decodes ASN.1 data structures using…
permissive · top 5,000 on PyPI
fold-to-asciiConverts Unicode characters outside the basic…
permissive · top 15,000 on PyPI
ecojiEncodes and decodes binary data as sequences of…
permissive · top 15,000 on PyPI
java-manifestEncode and decode Java's META-INF/MANIFEST.MF…
unclear · top 15,000 on PyPI