Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

This is a rather special kind of IO exception that indicates a mismatch between the bytes of a file and its encoding. For instance, if a POM file declares

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>

in its header, its binary contents must be a valid UTF-8 byte sequence. This means that any Non-ASCII character needs to be encoded as a sequence of two or more bytes. A file whose contents is not properly encoded, e.g. because a user edited/saved the file in another encoding than specified in the XML declaration, can cause this exception. While this exception is not raised on all JREs, the underlying issue is the same, the file contents is invalid and needs to be re-encoded to fit the declared encoding or the encoding given by the XML declaration needs to be adjusted to match the contents.