Bluesky facet offsets count bytes, not characters, tripping up script posts

A developer's report of incorrect hashtag positions in a Bluesky API response turned out to be correct, because facet ranges are measured in UTF-8 bytes rather than characters. An emoji occupies one character but four bytes, which shifts every later offset. The same mismatch surfaced in September 2024, when a consumer found mention highlighting broken on posts with accented characters. The author shows that the offsets are accurate when read as byte positions, and that indexing by character produces the correct handles. The guidance is to compute facet ranges from the UTF-8 encoding of the text.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in