3 ms·
I’m not sure the text/binary distinction is that useful. ASCII is much simpler than Unicode encodings, to the point where text can even become an attack vector
by jl6 9y ago
I’m not sure the text/binary distinction is that useful.
ASCII is much simpler than Unicode encodings, to the point where text can even become an attack vector. A fully featured UTF-8 parsing and rendering engine is a sophisticated thing.
Does it matter whether one or the other is classified as text or binary? Not as much as it matters which requires the more complex code to process.
- rollcat 9y ago> A fully featured UTF-8 parsing and rendering engine is a sophisticated thing. No, UTF8 decoding is trivial, you can do it in a few dozen lines in just about any language. It's Unicode that is a complex and moving target. But you can also just choose to implement a sane subset of Unicode for your application. Recommended reading: http://cat-v.org/ http://cat-v.org/, https://github.com/cls/libutf https://github.com/cls/libutf
- rootlocus 9y ago> I’m not sure the text/binary distinction is that useful. Encoding a number in binary takes 4 or 8 bytes. Encoding it in plain text (ASCII or Unicode) takes as many bytes as there are digits, plus one for the sign / decimal separator. If you're talking about ASCII/Unicode, you're not talking about text/binary. > ASCII is much simpler than Unicode encodings I don't disagree with you, but Unicode is not binary. > Does it matter whether one or the other is classified as text or binary? They're both text.