Files for "How to Translate an RTF File: What Survives, What Breaks, and What to Check" https://www.booktranslator.app/blog/translate-rtf-file check_rtf.py Python 3 standard library only. python3 check_rtf.py sample-word-style.rtf inspect a source file python3 check_rtf.py sample-word-style.rtf sample-word-style-translated.rtf compare a translation It reads the RTF markup directly. It is a pre-flight check, not a full RTF parser. sample-textedit.rtf Made on macOS with: textutil -convert rtf (Apple's text system, the same one TextEdit uses). Lines that ended in a space were joined to the next line so the file has no trailing whitespace; RTF ignores raw line breaks, so the content is unchanged. A heading, bold and italic words, a link, a bulleted list, a 2x2 table, and a line with braces and backslashes. Its paragraphs end with a backslash + line break, not \par. sample-textedit-source.html The HTML that sample-textedit.rtf was converted from. sample-word-style.rtf Hand-written in the style Microsoft Word uses: \par paragraph breaks, a page header, a footnote, a HYPERLINK field, a 2x2 table, a 1x1 PNG image, a page break, a cp1252 accent (\'e9) and two Unicode characters (\u26085? \u26412?). sample-long-numbers.rtf Three short paragraphs: a 20-digit order reference, a 40-character commit hash, and a phone number. *-translated.rtf, *-bilingual.rtf What came back when each sample went through a local copy of BookTranslator's RTF parsing and writing code (backend main 89dcc394, 2026-11-03). No model was used: every paragraph that would be sent for translation was replaced with "[ZH] " + the original text, so the files show exactly what is sent and how the file is rebuilt.