EPUBCheck PKG-010: space in a file name
Updated:
EPUBCheck PKG-010 is a warning message: “The file name "…" contains spaces, which may create interoperability issues with older reading systems.” A file name inside the EPUB contains spaces. That is allowed, but it can break older reading systems, and every URL that points to the file then has to encode the space correctly.
The official message
The file name "%1$s" contains spaces, which may create interoperability issues with older reading systems.
- Default severity
- Warning. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- Images or chapters named after their original titles, like "Chapter 1.xhtml".
- Files exported from a word processor or layout tool that keeps document names.
How to fix it
- Rename the file with hyphens or underscores instead of spaces.
- 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.
- If you keep the space, every URL that points to the file must encode it as %20.
When it's not this
If the name has characters such as : or ?, the error is PKG-009; a badly encoded URL is RSC-020.
Terms used here
Other PKG messages
PKG-009The file name "…" contains characters that are not allowed in OCF file names: ….PKG-011The file name "…" is not allowed to end with ".".PKG-008Unable to read file "…".PKG-012The file name "…" contains non-ASCII characters, which might create interoperability issues with older reading systems.PKG-007The content of the mimetype file must be the string "application/epub+zip"…PKG-006Mimetype file entry is missing or is not the first file in the archive.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.