logoalt Hacker News

delamontoday at 9:33 AM1 replyview on HN

I don't quite get it. 5-byte utf-8 encoding gets extra 5 bits compared to 4 byte, and 6-byte gets extra 10 bits. If you were thinking about bits in leading byte, then yes, you are losing one bit for every extra trailing byte, but you also get 6 bits from it. So adding a byte gives you extra 5 bits.


Replies

hnlmorgtoday at 9:48 AM

Yeah, you’re right. I might have attempted to do mental arithmetic before coffee…