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

Tiny text-fixer wins cheers, nitpicks, and one very cheeky naming debate

TLDR: Mojibake is a tiny two-file library for handling tricky text correctly, from accents to emoji, without extra add-ons. Commenters loved the lightweight idea but immediately started arguing over rivals, speed tests, and whether naming it after broken text is hilariously backwards.

A tiny new text-handling library called Mojibake just landed on Show HN, promising to help programmers deal with messy multilingual text with only two files and zero extra baggage. For the non-coders: this is basically a compact toolkit for making sure words, accents, emoji, and right-to-left languages don’t turn into gibberish. And the crowd reaction? Very much “finally, something small that doesn’t drag half the internet into my project.” One fan outright cheered the “cleaner, lightweight” approach, saying the C and C++ world has been starving for this kind of no-fuss tool.

But because this is the internet, applause instantly turned into comment-section side quests. One commenter dropped a gloriously dry hot take that the only Unicode support C really needs is “supporting pointers to char and arrays,” which is the software equivalent of saying, “Actually, I liked it better when text was just vibes.” Another jumped straight into comparison mode, asking how Mojibake stacks up against utf8proc, while someone else tossed in a totally different benchmark challenge: “what’s performance like compared to python ftfy module?” Translation: cool demo, now prove it in the ring.

The funniest mini-drama, though, was over the name. “Mojibake” usually refers to text that’s already broken, so one commenter politely-but-pointedly asked whether naming a Unicode library after garbled text was a bit like naming your dentist “Cavity.” That joke practically writes itself. So yes, the project impressed people with its small size and ambitious feature list—but the real entertainment was watching the crowd debate whether it’s a lifesaver, overkill, or just the most ironically named text tool on the internet.

Key Points

  • Mojibake is a low-level Unicode 17 library written in C11, compatible with C++17, and released under the MIT License.
  • The library is distributed as two source files, mojibake.c and mojibake.h, with zero dependencies and no installation requirement.
  • The article demonstrates Unicode normalization, Unicode-aware string length counting, and NFKC case folding using UTF-8 examples.
  • Mojibake is described as running on Linux, macOS, FreeBSD, OpenBSD, NetBSD, and Windows 10/11, and as passing official Unicode test suites for supported algorithms.
  • Its feature set includes normalization, case conversion, filtering, Unicode character database access, segmentation, bidirectional text processing, emoji analysis, and display-width handling.

Hottest takes

"the only Unicode support needed in C is supporting pointers to char and arrays" — avadodin
"How does it compare with utf8proc?" — lifthrasiir
"isn’t the word 'mojibake' synonymous with 'when character encoding breaks'?" — CharlesW
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.