When garbled text and broken images appear in the same KDP ebook manuscript, it is tempting to repair everything in one export. Encoding and resource paths are different systems, however. If both change at once, a successful output does not reveal which correction worked. A safer preflight uses two independent lanes: one proves that the manuscript text was decoded and resaved correctly; the other proves that every image reference reaches the intended packaged asset.
The examples below come from retained synthetic evidence: a short Shift_JIS specimen reopened as UTF-8/LF and a three-chapter EPUB containing three body images plus a cover. The method is designed to detect problems before an authoritative source is overwritten. It is not a promise to recover already corrupted binary data or to predict KDP acceptance.
Protect the Source and Open Two Ledgers
Duplicate the source before conversion and record its filename, modification time, and SHA-256 digest. Create separate working copies for text and image inspection. Neither copy should overwrite the original during diagnosis.
The text ledger records detected encoding, newline style, character count, output encoding, and content comparison. The image ledger records chapter, Markdown path, generated XHTML src, OPF manifest href, packaged filename, and missing status. Keeping the ledgers separate gives every failure one return point. If the text passes but an image path fails, the encoding output can remain frozen. If all assets resolve but one sentence changes, only the text lane needs another run.
Define acceptance before opening the files. “It looks fine” is not a reproducible text rule, and “the image directory is not empty” is not a resource rule.
Prove Text Content After Encoding Conversion
Begin by detecting the source encoding and newline form. Preserve that observation. Do not label a document UTF-8 simply because one editor displays Japanese characters correctly. Convert to a separately named UTF-8/LF file, close it, and reopen that exact result. Compare character count and representative sentences with the intended source content.
In the retained addendum for this article, a Shift_JIS input was detected and the synthetic specimen was reopened as UTF-8/LF. Its body contains 34 characters when the terminal newline is excluded. The file then ends with one LF character, so rune inspect text reports characterCount: 35. In other words, 34 is the body-only count and 35 is the inspection count that includes the final LF; neither number describes the length of a production manuscript. For a real book, sample characters that are likely to expose a bad conversion: long dashes, ellipses, uncommon kanji, full-width punctuation, and symbols copied from another application.
A matching character count is useful but insufficient. Two different strings can have the same length. Compare selected text values or a normalized content digest as well. If line endings are intentionally changed, record that transformation separately from character decoding.
Rune Studio’s documented Japanese-encoding detection and unconvertible-character warnings can support this checkpoint. The retained run did not test visually inspecting a deliberately mis-decoded document and overwriting it, so do not claim that a warning alone proves safe recovery. The reopened content remains the decisive evidence.
Trace Every Image From Source Reference to ZIP Entry
For the image lane, start with references in the manuscript rather than with the asset folder. Connect the Markdown relative path to the generated XHTML src, the OPF manifest href, and the actual ZIP entry. A row fails if any name or directory level differs. On case-sensitive systems, capitalization differences also matter.
The retained EPUB has three manuscript chapters. It packages three chapter images and one cover image, for four image resources in total. Generated XHTML also contains four image references, and all four targets exist. The package has seven spine items, three navigation links, three NCX points, and zero missing resources. Rune’s local inspection returned valid=true.
The cover is part of the four-image total, so do not compare that number with body-image count alone. Also distinguish “missing” from “unused.” An image may exist in the ZIP without being referenced. That does not create a missing target, but it should be removed or explained so the handoff does not carry stale assets.
Freeze the Text Result Before Repairing Paths
Complete the text lane first. Once the separately named UTF-8/LF file reopens with the expected content, record its digest and use that exact file as the fixed input to image repair. Correct only the failing rows in the image ledger. Then export a new EPUB name rather than overwriting the previous result.
After export, rerun the local package inspection and independently recover the expected values: three chapter destinations, four image references, four image resources, and zero missing targets. Open at least one image beside its surrounding chapter heading. A four-to-four count can still pass while chapter one points to chapter two’s illustration; content pairing catches that error.
Preserve the rejected output. Its digest and the corrected output’s digest show that the test did not silently replace evidence. Record which ledger changed and which one remained frozen.
Use the Symptom to Choose the Return Point
If text contains replacement characters such as � or becomes unreadable punctuation, leave the image configuration untouched and return to the original byte stream and detected encoding. If only line breaks changed, compare decoding and newline conversion in separate fields. If an image is absent, trace its XHTML reference through the manifest to the ZIP path and check capitalization.
If an image appears but it is the wrong illustration, a missing-resource check will not help. Compare the packaged asset digest with the approved source image and read its chapter context. If the cover is wrong, inspect both the cover-image role in the OPF and the cover XHTML reference; finding a file named cover is not enough.
Rerun only the lane that failed, but perform a regression check on the combined EPUB after generation. The two-lane model narrows the repair; it does not exempt the final package from complete inspection.
Separate Structural Evidence From Visual and Retailer Checks
The retained evidence supports two bounded claims. First, a Shift_JIS specimen containing 34 body characters plus one terminal LF was reopened as UTF-8/LF; characterCount was 35 before and after conversion because that inspection value includes the LF. Second, the fixed EPUB contains four image resources, four image references, seven spine items, three navigation links, three NCX points, and zero missing resources, with a successful local inspection.
Those observations do not prove KDP ingestion, identical display across devices, correct cropping, or high-quality alternative text. They also do not perform OCR, reconstruct corrupted binary data, or clear image rights. Maintain separate visual and editorial checks for those questions. Open representative pages at the target reading sizes and inspect the actual illustrations, but record that as human evidence rather than as part of the package-validity result.
Hand Off One File That Passes Both Lanes
The final text record should include source digest, detected encoding, converted digest, newline form, character count, and representative content comparison. The image record should include chapter, original reference, packaged path, output digest, missing result, and content match. Both ledgers must name the same final EPUB.
This last comparison prevents a subtle handoff error: one EPUB may contain corrected text while a different export contains corrected images. Close and reopen the actual delivery file, read one representative sentence, open one image from each chapter, and rerun the zero-missing check.
A KDP ebook manuscript is ready for the next acceptance stage only when the text and resource lanes converge on that same reopened artifact. Keeping the lanes distinct during diagnosis makes repair explainable; joining them at handoff ensures that the customer receives one coherent book rather than two partial successes.


