Gilad Resisi bd781c1cd8 fix: count Threads post length in UTF-8 bytes
Meta's Threads API counts the 500-character post limit in UTF-8 bytes (https://developers.facebook.com/docs/threads/posts), while Postiz counted UTF-16 code units, so a post with curly quotes, accented letters or emoji could pass the editor counter and the server validation and then be rejected by Threads at publish time. A thread whose second part was affected published only its first part.

Adds a countLength helper (X keeps twitter-text weighted length, Threads uses UTF-8 byte length, everything else plain length) and uses it in the /posts/valid check and in the editor character pill, so both sides flag the same text. The global-mode pill now shows the count for the channel whose limit it displays instead of the raw length.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TEjfd79TJocNAFULswHkXV
2026-08-23 09:57:45 +07:00
..