![]() ![]() UTF-8 is not a good transport for arbitrarily encoded binary data. :-) How to do so is left as an exercise for the reader. To take an extremely stupid example: if your channel passes all 256 characters without issues, and you don't need any separators, then you can write a trivial transform that achieves 100% efficiency. So the choice of an encoding really depends on your requirements. It's easy to define a transform that comes pretty close.īut: what if you need a separator character? Now you only have 94 characters, etc. Each character can theoretically encode log2(95) ~= 6.57 bits per character. you may require pure ASCII text, whose printable characters range from 0x20-0x7E. Now: why do you need text? Typically, it's because the communication channel does not pass through all characters equally. ![]() We can then assume that the distribution of 1/0 or individual bytes is more or less random. This really depends on the nature of the binary data, and the constraints that "text" places on your output.įirst off, if your binary data is not compressed, try compressing before encoding. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |