Search code examples
javaxmlutf-8ansixmi

Import an XMI file to a XML project Error : Invalid byte 1 of 1-byte utf-8 sequence


When I import my file XMI to my UML project (java project) I got a messege error

org.xml.sax.SAXParseException :  Invalid byte 1 of 1-byte utf-8 sequence.

In my file I used ANSI before, I rewrite in the file XMI.

I have no idea what's happened, someone could help me ?


Solution

  • If your XML file is not UTF-8 encoded, then you need an XML declaration as first line giving the actual encoding. For example

    <?xml version="1.0" encoding="ISO-8859-1"?>