Prevent Encoding Errors During EPUB Production

EPUB production encoding errors are best controlled at two specific points: when a manuscript enters the production batch and immediately before it becomes package input. A one-time encoding check is not enough if chapter names, credits, or captions change later. The production record must show which revision passed each checkpoint.

Issue an admission ticket to every manuscript

The ticket should identify the received filename, source hash, detected encoding, line ending, and three readable checkpoints: a heading near the start, a proper name in the middle, and an end marker. Preserve the received file and perform changes in a numbered working copy. If the production standard is UTF-8, write that policy down; do not silently mix a correctly detected Shift_JIS chapter into a UTF-8 batch.

This gate can be built without Rune Studio. Open a duplicate with an explicit decoder, read the three checkpoints, save under a new name, close it, and inspect the resulting file. The value passed downstream must come from disk after save, not from the menu choice that requested the encoding.

The admission gate is intentionally narrow. It is not a promise to recover already corrupted data, perform OCR, or repair binary files. Its purpose is to prevent an uncertain source from becoming the basis for layout, navigation, and image work.

Repeat the check only after production has changed the input

Adding an afterword, replacing a title, or inserting a caption can introduce characters that were not present at admission. Before export, compare the current hash with the ticket. If it matches, repeat the saved-file readback. If it differs, identify the approved changes and issue a new ticket rather than pretending the old test still covers the file.

The second checkpoint does not require rereading an entire novel. Choose revealing text: uncommon names, punctuation that matters to the project, and the final marker. Add every newly introduced special character to the checklist. This gives the production team a small, repeatable test while preserving responsibility for editorial meaning.

When several chapters are involved, keep one row per file. A single passing chapter cannot stand in for the batch. If chapter three changes, retest chapter three and any combined export that consumes it; do not transform the other accepted chapters merely to make the workflow look uniform.

Stop two different failures in a three-file batch

The cycle-six batch contained chapter one, chapter two, and a colophon. Chapter one was valid UTF-8. Chapter two contained Shift_JIS bytes in a UTF-8 production intake. The colophon ended with a deliberately truncated multibyte sequence. A strict UTF-8 preflight rejected two of the three files.

Rune Studio independently identified chapter two as Shift_JIS. A working copy was decoded strictly as Shift_JIS and serialized strictly as UTF-8. The incomplete colophon character was not guessed from the damaged bytes; it was restored from the fixed synthetic intake ticket. These failures require different return paths, which is why a blanket conversion over all three inputs would be unsafe.

Reinspect all three closed production files

The Shift_JIS chapter was opened in a dedicated Rune Studio workspace and its tab was set to UTF-8. In the development CLI used here, that response represented workspace state rather than proof that the file bytes had been serialized. The strict Shift_JIS-to-UTF-8 serialization was therefore recorded as a separate step. Chapter one remained untouched, and the colophon was saved from its intake-ticket source.

Rune then reinspected all three closed repaired files as UTF-8. The batch moved from two files with strict UTF-8 errors to zero. That is the production exit value: three named disk files, three UTF-8 detections, and no remaining strict UTF-8 error. A menu or tab response alone would not satisfy it.

Rune Studio's current Mac product documentation describes highlighting characters unavailable in a selected encoding and pausing automatic saving. The CLI evidence did not measure that color or timing. The article keeps documented interface behavior separate from the measured batch files.

Return only the affected unit

If a chapter fails its middle checkpoint immediately after opening, return that source copy to the decoding step. If the checkpoints were correct before save and wrong afterward, investigate the chosen output encoding and path. If the saved source is correct but the exported XHTML lacks a marker, inspect the selected revision and EPUB conversion rather than recoding every chapter.

This routing protects accepted files from unnecessary changes. It also makes the failure useful: the production manager can identify whether the issue belongs to receipt, editing, persistence, or packaging. Keep rejected candidates with short reasons until the batch is accepted.

Overlay the production ticket with a later package ticket

This cycle measured admission, repair, and closed-file UTF-8 reinspection for three source files. It did not infer an EPUB package result from those source checks. Once the files have passed, their hashes can be fixed as package inputs, and the generated XHTML can be checked for the same heading and colophon marker.

Rune Studio is useful when multiple manuscripts and EPUB settings remain in one workspace. A specialized recovery source is still required when bytes are missing and no intake ticket exists. Retailer acceptance and identical rendering in all readers also remain outside this production-input test.

The final sheet should preserve two dates: admission and pre-export. In this run, admission failed two of three files; the repaired pre-export set passed all three as UTF-8 with zero strict errors. Package structure belongs on a later, separate row.

Hand off a revision, not merely a filename.

The practical outcome is a chain of identity. The manuscript that entered the batch is tied to a hash; an approved change creates a new ticket; the pre-export inspection names that revision; and the package record names the EPUB produced from it. If any link is missing, repeat that link instead of rerunning unrelated work.

To prevent EPUB production encoding errors, begin with one representative chapter. Build its admission and exit ticket, close and reopen the saved file, and trace that exact revision into a test package. Once the record is repeatable, expand it to the rest of the batch. The discipline lies in controlling revisions, not in trusting a single reassuring encoding label.