Skip to content
EPUBCheck · Package and ZIP container

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

  1. Rename the file with hyphens or underscores instead of spaces.
  2. 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.
  3. 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-009 The file name "…" contains characters that are not allowed in OCF file names: ….
  • PKG-011 The file name "…" is not allowed to end with ".".
  • PKG-008 Unable to read file "…".
  • PKG-012 The file name "…" contains non-ASCII characters, which might create interoperability issues with older reading systems.
  • PKG-007 The content of the mimetype file must be the string "application/epub+zip"…
  • PKG-006 Mimetype 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.

FAQ

What does EPUBCheck PKG-010 mean?

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.

Is PKG-010 an error?

PKG-010 is reported as warning by default. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.