EPUBCheck PKG-009: forbidden file name character
Updated:
EPUBCheck PKG-009 is an error message: “The file name "…" contains characters that are not allowed in OCF file names: ….” A file name inside the EPUB contains a character that the EPUB container rules do not allow in file names. The restriction exists so that the same names work on every operating system that unpacks the book.
The official message
The file name "%1$s" contains characters that are not allowed in OCF file names: %2$s.
- Default severity
- Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- Characters such as ", *, :, <, >, ?, \ or |, or control characters, usually copied from the original title of an image or chapter.
- Files exported from a tool that names them after headings or captions.
How to fix it
- Rename the file using letters, digits, hyphens and underscores.
- After renaming, update every reference to the file: the manifest in the package document, links and image sources in the XHTML, and url() references in the CSS.
- Rebuild the archive and validate again; any reference you missed shows up as RSC-007.
When it's not this
Spaces are allowed and only give the PKG-010 warning; non-ASCII letters give PKG-012.
Terms used here
Other PKG messages
PKG-008Unable to read file "…".PKG-010The file name "…" contains spaces, which may create interoperability issues with older reading systems.PKG-007The content of the mimetype file must be the string "application/epub+zip"…PKG-011The file name "…" is not allowed to end with ".".PKG-006Mimetype file entry is missing or is not the first file in the archive.PKG-012The file name "…" contains non-ASCII characters, which might create interoperability issues with older reading systems.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.