# EPUBCheck RSC-028: XML file not in UTF-8, how to fix it

Source: https://epubcc.com/epubcheck/rsc-028/ (updated 2026-11-04)

EPUBCheck RSC-028 is an error message: “XML documents must be encoded in UTF-8, but … was detected.” An XML file uses an encoding other than UTF-8, which EPUB requires for XML documents. Characters such as accents and quotes can show as garbage in reading apps.

- Official message (EPUBCheck 5.4.0): XML documents must be encoded in UTF-8, but %1$s was detected.
- Default severity: Error

## Typical causes

- A file saved as ISO-8859-1, Windows-1252 or another legacy encoding, often declared in its XML declaration.
- Text pasted from another document and saved with the editor's default encoding.

## How to fix it

1. Open the file named in the message in an editor that can change encodings.
2. Convert the file to UTF-8 and change the XML declaration to encoding="UTF-8" (or remove the encoding attribute).
3. Check accented characters after converting, then validate again.

## When it's not this

UTF-16 is only a warning, RSC-027.

## Sources

- EPUB 3.3, §3.9 XML conformance: https://www.w3.org/TR/epub-33/#sec-xml-constraints (read 2026-11-04)

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