--- id: mutf8 version: "1.1.0" license: MIT license_treatment: permissive maintenance: active --- # mutf8 — Fast MUTF-8 encoder & decoder License: permissive · Maintenance: active · Downloads: 2.1M/mo ## 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 above — 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 pip install mutf8 uv add mutf8 poetry add mutf8 ## Installing 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_current - Install friction: medium - Maintenance: active - Downloads: 2.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags mutf-8 encoder decoder, java class file encoding, jni string encoding, modified utf-8 python, jvm string serialization, cesu-8 alternative, java bytecode strings, jvm-interop, character-encoding, java-bytecode [View on SkillFed](https://skillfed.io/packages/mutf8) · [View on PyPI](https://pypi.org/project/mutf8/)