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.
Show HN: Mojibake – A low-level Unicode library written in C
11–20 of 25 posts
Re: Show HN: Mojibake – A low-level Unicode library written in C
#12I 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…
It's a hobby project I wrote because I find the Unicode standard (sometimes unnecessary) complexity fascinating. And for other people to use, if needed.
The HTML page is static and generated at compile time. Every function has a little form to test the WASM function.
Re: Show HN: Mojibake – A low-level Unicode library written in C
#13How 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/
Re: Show HN: Mojibake – A low-level Unicode library written in C
#14Love the amalgamation approach—the C/C++ ecosystem desperately needs cleaner, lightweight Unicode support without pulling in massive dependencies... thanks for sharing
Re: Show HN: Mojibake – A low-level Unicode library written in C
#15Not to bikeshed, but isn't the word "mojibake" synonymous with "when character encoding breaks"?
Re: Show HN: Mojibake – A low-level Unicode library written in C
#16what's performance like compared to python ftfy module?
Re: Show HN: Mojibake – A low-level Unicode library written in C
#17I 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.
I guess you never have to deal with text if you think that’s enough? What kind of software do you write in C?
A cursory look at the services provided by this library should dissuade people from attempting to work with Unicode text in C.
You can of course use or build a text processing engine's DSL that does all sorts of things people may want to do with Unicode text but C is hardly the best fit.
Re: Show HN: Mojibake – A low-level Unicode library written in C
#18I 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.
With Mojibake, I wanted to help people handle text by providing the smallest possible C/C++ library, without requiring them to use a +20MB library just to normalize a string, handle a flag emoji, or perform similar tasks.
See the CONFORMANCE_REQUIREMENTS.md file if you are interested in what the +17 versions of the Unicode standard have introduced.
Re: Show HN: Mojibake – A low-level Unicode library written in C
#19I 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.
How do you check if it's a valid character?
How do you deal with combining characters?
Most of the world don't use just the Latin subset in ASCII or follow the same assumptions about letters, words, cases etc etc.
Re: Show HN: Mojibake – A low-level Unicode library written in C
#20I 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.
(Author here) Dealing with encodings is already a big step when you aim to handle multiple ones and multiple OSes. You can see what I am talking about in the tests/ folder. With Mojibake, I wanted to help people handle text by providing the smallest possible C/C++ library, without requiring them to use a +20MB library just to normalize a string, handle a flag emoji, or perform similar tasks. See the CONFORMANCE_REQUI…
The people using it will probably have an easier time navigating Unicode text than they would have if they had used other existing libraries or tried to roll their own.
It's more a comment on the users who need to be warned that "no, you probably don't want your C program to know if that string actually fits in the 80 column terminal".