Post #4405614
2026-08-06 04:08 UTC
i think a very compact decoder can be made.
basically we pick four-byte emoji. the first two bytes are always F0 9F . that leaves two usable bytes
now there's only 4000 ish emoji not 65535 so unfortunately we can't just store 16 bits per emoji, but as it turns out, there are 256 emoji that map to the values 0-255 with the same divisor
that means we can decode "data emoji" into arbitrary bytes via
lodsw ; throw away f0 9f
lodsw ; read 16-bit payload
aad 8Fh ; convert 16-bit payload to 8bit value
stosb ; write it to the output buffer
that's the basic loop
Replies (1)
-
@gloriouscow@oldbytes.space 2026-08-06 04:13
at a certain point the decoder strategy is going to win out size-wise over trying to actually make any complicated logic in emoji directly due to the convoluted way you have to go about implementing basic things, even though the encoding is only 25% efficient but if you think about it, 25% efficient just means you have a 1:1 mapping between bytes and emoji. i can live with that