Show HN: Mojibake – A low-level Unicode library written in C

program 56 points 9 comments July 16, 2026
mojibake.zaerl.com · View on Hacker News

I've written Mojibake because I don't like the other Unicode libraries for Unicode support. It consists of only two amalgamation files: mojibake.h and mojibake.c. I've added all the most important Unicode algorithms, such as normalization, case conversion, segmentation, bidirectional text, collation, confusable, and others. I regularly test it in these OSes: Linux, macOS, FreeBSD, OpenBSD, NetBSD, and Windows 11. You can find a WASM demo on that site of all the public API functions and the documentation. If you want to participate, feel free to do it. Any kind of help is welcome. Check the CONTRIBUTING.md and API.md files in the GitHub repository for instructions on how to do it.

Discussion Highlights (6 comments)

digg99

Love the amalgamation approach—the C/C++ ecosystem desperately needs cleaner, lightweight Unicode support without pulling in massive dependencies... thanks for sharing

avadodin

I have come to the conclusion that the only Unicode support needed in C is supporting pointers to char and arrays but lightweight C libraries are always welcome.

lifthrasiir

How does it compare with utf8proc [1]? I'm aware that Mojibake does a bit more than utf8proc (e.g. bi-di) but that seems marginal to me. [1] https://juliastrings.github.io/utf8proc/

tjwebbnorfolk

what's performance like compared to python ftfy module?

CharlesW

Not to bikeshed, but isn't the word "mojibake" synonymous with "when character encoding breaks"?

throwaway2037

I assume the submitter is also the author. If so, can you share about your motivation to write this library? For example, do you use it professionally or in hobby projects? Did you look at other libraries and think that you could do better? These are honest questions -- no trolling from me. I browsed the code and it looks very clean. The API documention is so nice! It looks like index.html from https://mojibake.zaerl.com/ uses JavaScript to generate the page. Very cool, indeed.

Semantic search powered by Rivestack pgvector
14,015 stories · 131,331 chunks indexed