Skip to content
EPUBCheck · Resources and references

RSC-027

Updated:

EPUBCheck RSC-027 is a warning message: “XML document is encoded in UTF-16. It should be encoded in UTF-8 instead.” An XML file is encoded in UTF-16; EPUB recommends UTF-8 for every XML document.

The official message

XML document is encoded in UTF-16. It should be encoded in UTF-8 instead.

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

Typical causes

  • A file saved in UTF-16 by an editor, common with some Windows tools.

How to fix it

  • Re-save the file as UTF-8 and make its XML declaration say encoding="UTF-8".

Terms used here

Other RSC messages

  • RSC-026 URL "…" leaks outside the container (it is not a valid-relative-ocf-URL-with-fragment string)
  • RSC-028 XML documents must be encoded in UTF-8, but … was detected.
  • RSC-029 Data URL is not allowed in this context.
  • RSC-030 File URLs are not allowed in EPUB, but found "…".
  • RSC-031 Remote resource references should use HTTPS, but found "…".
  • RSC-032 Fallback must be provided for foreign resources, but found none for resource "…" of type "…".

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

FAQ

What does EPUBCheck RSC-027 mean?

EPUBCheck RSC-027 is a warning message: “XML document is encoded in UTF-16. It should be encoded in UTF-8 instead.” An XML file is encoded in UTF-16; EPUB recommends UTF-8 for every XML document.

Is RSC-027 an error?

RSC-027 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.