# commands.log: alt-text-character-limit, December 1, 2026 (server: Ubuntu 24.04.5 LTS, Python 3.12.3, Node v24.21.0) # Each published command as run, its exit code and the edge inputs it was also tried on. The scripts sit next to this file; test-run.sh rebuilds every test file. published: python3 alt-length-check.py alt.txt ran: python3 alt-length-check.py alt.txt exit=0 | 1 66 UTF-16 66 cp first sentence 66 OK | 2 77 UTF-16 77 cp first sentence 77 OK | 3 82 UTF-16 82 cp first sentence 82 OK | 4 54 UTF-16 52 cp first sentence 54 emoji or symbols: 54 UTF-16 vs 52 code points | 5 67 UTF-16 65 cp first sentence 67 emoji or symbols: 67 UTF-16 vs 65 code points | 6 51 UTF-16 48 cp first sentence 51 emoji or symbols: 51 UTF-16 vs 48 code points | 7 50 UTF-16 48 cp first sentence 50 emoji or symbols: 50 UTF-16 vs 48 code points | 8 60 UTF-16 60 cp first sentence 60 OK | 9 83 UTF-16 83 cp first sentence 48 OK | 10 457 UTF-16 457 cp first sentence 66 OK | RESULT: 10 alt texts, all fit edge: the length controls (500/501, 1000/1001, 2000/2001 plain, and 999 code points with 5 flags = 1009 UTF-16) ran: python3 alt-length-check.py alt-over.txt exit=1 | 1 500 UTF-16 500 cp first sentence 16 OK | 2 501 UTF-16 501 cp first sentence 16 over: Pinterest | 3 1000 UTF-16 1000 cp first sentence 16 over: Pinterest | 4 1001 UTF-16 1001 cp first sentence 16 over: Pinterest, X, Threads API / Instagram API | 5 2000 UTF-16 2000 cp first sentence 16 over: Pinterest, X, Threads API / Instagram API, Mastodon before 4.6 | 6 2001 UTF-16 2001 cp first sentence 16 over: Pinterest, X, Threads API / Instagram API, Mastodon before 4.6, Bluesky | 7 1009 UTF-16 999 cp first sentence 16 over: Pinterest, X, Threads API / Instagram API; emoji or symbols: 1009 UTF-16 vs 999 code points | RESULT: 7 alt texts, 6 to fix edge: Windows line breaks (CRLF) and a decomposed accent (NFD) ran: python3 alt-length-check.py alt-crlf.txt exit=0 | 1 66 UTF-16 66 cp first sentence 66 OK | 2 77 UTF-16 77 cp first sentence 77 OK | 3 82 UTF-16 82 cp first sentence 82 OK | RESULT: 3 alt texts, all fit edge: one run-on sentence over 120 characters (fits every limit, but the main point is not up front) ran: python3 alt-length-check.py runon.txt exit=1 | 1 153 UTF-16 153 cp first sentence 153 first sentence 153, not under 120: put the main point in a shorter opener | RESULT: 1 alt text, 1 to fix edge: blank lines between alt texts (rows show file line numbers 1 and 4) ran: python3 alt-length-check.py blanks.txt exit=0 | 1 34 UTF-16 34 cp first sentence 34 OK | 4 31 UTF-16 31 cp first sentence 31 OK | RESULT: 2 alt texts, all fit edge: first sentence of exactly 119 and 120 characters (120 is not under 120, so it is flagged) ran: python3 alt-length-check.py exact120.txt exit=1 | 1 127 UTF-16 127 cp first sentence 119 OK | 2 128 UTF-16 128 cp first sentence 120 first sentence 120, not under 120: put the main point in a shorter opener | RESULT: 2 alt texts, 1 to fix edge: openers with Dr., a period inside quotes, a CJK full stop and an ellipsis ran: python3 alt-length-check.py tricky.txt exit=1 | 1 140 UTF-16 140 cp first sentence 133 first sentence 133, not under 120: put the main point in a shorter opener | 2 140 UTF-16 140 cp first sentence 30 OK | 3 120 UTF-16 120 cp first sentence 11 OK | 4 127 UTF-16 127 cp first sentence 25 OK | RESULT: 4 alt texts, 1 to fix edge: openers with U.S., a.m./p.m., etc. and a web address (a word with a dot inside does not end the sentence, so openers that end in etc. or koldflux.com. run on; Blvd., not in the list, ends the sentence early and a long opener passes) ran: python3 alt-length-check.py dotted.txt exit=1 | 1 134 UTF-16 134 cp first sentence 127 first sentence 127, not under 120: put the main point in a shorter opener | 2 133 UTF-16 133 cp first sentence 126 first sentence 126, not under 120: put the main point in a shorter opener | 3 129 UTF-16 129 cp first sentence 129 first sentence 129, not under 120: put the main point in a shorter opener | 4 130 UTF-16 130 cp first sentence 130 first sentence 130, not under 120: put the main point in a shorter opener | 5 134 UTF-16 134 cp first sentence 18 OK | RESULT: 5 alt texts, 4 to fix edge: styled fancy-text bold letters (each is 2 UTF-16 units, 1 code point) ran: python3 alt-length-check.py fancy.txt exit=0 | 1 29 UTF-16 25 cp first sentence 29 emoji or symbols: 29 UTF-16 vs 25 code points | RESULT: 1 alt text, all fit edge: an empty file ran: python3 alt-length-check.py empty.txt exit=2 | ERROR: empty.txt has no alt text lines edge: a missing file ran: python3 alt-length-check.py missing.txt exit=2 | ERROR: cannot read missing.txt: No such file or directory edge: a file saved as Latin-1, not UTF-8 ran: python3 alt-length-check.py latin1.txt exit=2 | ERROR: latin1.txt is not UTF-8 (byte 3); save it as UTF-8 and run again edge: no file given (prints the usage) ran: python3 alt-length-check.py exit=2 | Check alt texts against published platform limits. | Usage: python3 alt-length-check.py alt.txt (one alt text per line, UTF-8; blank lines are skipped) | Counts each line in UTF-16 units (what the Koldflux Word counter and Bluesky count) and in code points | (Python len()). A limit is flagged against the larger count, so emoji never push you over by surprise. | The first number on each row is the line number in the file. | The first sentence ends at the first . ! ? … or 。 followed by a space or the end of the line (a closing quote | or bracket may come between). It does not stop after the abbreviations listed below (Dr., St., etc.), | a single capital initial (J.) or a word with a dot inside (U.S., a.m., e.g., koldflux.com). It is a rough split: an abbreviation | missing from the list (Blvd.) ends the sentence early, and an opener that really ends in a skipped form | (etc., U.S., a web address) runs on into the next sentence, so glance at every line, not only the flagged ones. | Exit 0 = every line fits every limit and has a first sentence under 120 characters, | 1 = at least one line needs a fix, 2 = file problem or no file given.