EPUBCheck RSC-027: XML file encoded in UTF-16
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. It is a warning: the file is still read, but some reading apps handle UTF-16 poorly.
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 that call it "Unicode".
- Files exported by an older word processor or script with UTF-16 as the default.
How to fix it
- Open the file named in the message in an editor that can change encodings.
- Re-save it as UTF-8 and make its XML declaration say encoding="UTF-8".
- Validate again.
When it's not this
Any other non-UTF-8 encoding (ISO-8859-1, Windows-1252) is the error RSC-028.
Terms used here
Other RSC messages
RSC-026URL "…" leaks outside the container (it is not a valid-relative-ocf-URL-with-fragment string)RSC-028XML documents must be encoded in UTF-8, but … was detected.RSC-025Informative parsing error: …RSC-029Data URL is not allowed in this context.RSC-024Informative parsing warning: …RSC-030File URLs are not allowed in EPUB, but found "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.