Menu formatter
USSD formatter
Write each language's menu, pick its encoding, split it into pages that fit, and force its direction.
Reading the text kept in this tab.
Characters per Page
A MAP USSD string is specified at up to 160 octets. GSM-7 packs those octets into 182 septets, Latin-1 spends one octet per character for 160, and UCS-2 spends two for 80. Each language starts from the default for its own encoding. An extension character such as € costs two septets in GSM-7.
Word or line
By word fills each page and breaks between words, even in the middle of a line. By line keeps every line whole and moves it to the next page when it does not fit. A single line that is longer than a whole page is split at a word. Next and Back lines are part of the page and use the same budget.
Direction marks are per page
Right puts RLE (U+202B) at the start of every page and Left puts LRE (U+202A) there. PDF (U+202C) closes every page. The marks are not added per line. They only exist in UCS-2, so alignment is off for a GSM-7 or Latin-1 language. Each mark is one of the 80 UCS-2 characters, and pagination counts both.