あ、あんまり関係ないけどUTF-8のデコードを自分で組むのは悪意のあるUTF-8シーケンスに対して脆弱になりうるのでやめようね!
4バイトになるシーケンスの先頭バイトのあと、残りの3バイトを意味のある部分だけではなくちゃんと上位ビットの正当性も検証しろよな、という話だったはず
Mastodon is the best way to keep up with what's happening.
Follow anyone across the fediverse and see it all in chronological order. No algorithms, ads, or clickbait in sight.