Skip to content
EPUBCheck · Package and ZIP container

EPUBCheck PKG-027: file names not in UTF-8

Updated:

EPUBCheck PKG-027 is a fatal error message: “Could not extract EPUB ZIP content, probably due to file names not encoded in UTF-8.” EPUBCheck could not extract the archive, most likely because the file names inside the ZIP are not encoded in UTF-8. It is a fatal error: the content cannot be checked until the archive is rebuilt.

The official message

Could not extract EPUB ZIP content, probably due to file names not encoded in UTF-8.

Default severity
Fatal error. EPUBCheck could not continue checking this part of the EPUB. The file is invalid.
EPUBCheck version
5.4.0

Typical causes

  • A ZIP created by an old tool or on a system that stores file names in a local code page, often with accented characters in the names.
  • Files named in another script (Cyrillic, Japanese) zipped by a tool without UTF-8 support.

How to fix it

  1. Rename files to ASCII names, or rebuild the archive with a tool that stores names in UTF-8.
  2. Rebuild the archive with the mimetype file first and stored uncompressed, for example from the folder that contains the book: zip -X0 book.epub mimetype and then zip -rX9 book.epub META-INF OEBPS (use your own folder names).
  3. Run EPUBCheck again on the rebuilt file and fix any message that appears next: a damaged archive can hide other problems until it can be read.

When it's not this

Non-ASCII names that do extract correctly only give the PKG-012 usage message.

Terms used here

Other PKG messages

  • PKG-026 Obfuscated resource must be a Font Core Media Type (was declared as "…" in "…").
  • PKG-025 Publication resource must not be located in the META-INF directory
  • PKG-023 Validating the EPUB against version 2.0, default validation profile will be used.
  • PKG-022 Wrong file extension for image. The image is a "…" file but has the file extension "…".
  • PKG-021 Corrupted image file encountered.
  • PKG-020 OPF file "…" could not be found.

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck PKG-027 mean?

EPUBCheck PKG-027 is a fatal error message: “Could not extract EPUB ZIP content, probably due to file names not encoded in UTF-8.” EPUBCheck could not extract the archive, most likely because the file names inside the ZIP are not encoded in UTF-8. It is a fatal error: the content cannot be checked until the archive is rebuilt.

Is PKG-027 an error?

PKG-027 is reported as fatal error by default. EPUBCheck could not continue checking this part of the EPUB. The file is invalid.