have tests for visualization and ubl convert. Insist in UTF-8 as charset in more cases.
This commit is contained in:
@@ -62,7 +62,7 @@ public class XMLValidator extends Validator {
|
||||
// file existence must have been checked before
|
||||
|
||||
try {
|
||||
zfXML = new String(XMLTools.removeBOM(Files.readAllBytes(Paths.get(name))));
|
||||
zfXML = new String(XMLTools.removeBOM(Files.readAllBytes(Paths.get(name))), StandardCharsets.UTF_8);
|
||||
} catch (IOException e) {
|
||||
|
||||
ValidationResultItem vri = new ValidationResultItem(ESeverity.exception, e.getMessage()).setSection(9)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.mustangproject.validator;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
@@ -166,7 +167,7 @@ public class ZUGFeRDValidator {
|
||||
|
||||
byte[] content=Files.readAllBytes(file.toPath());
|
||||
content= XMLTools.removeBOM(content);
|
||||
String s=new String(content);
|
||||
String s=new String(content, StandardCharsets.UTF_8);
|
||||
InputSource is = new InputSource(new StringReader(s));
|
||||
Document doc = db.parse(is);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user