have tests for visualization and ubl convert. Insist in UTF-8 as charset in more cases.

This commit is contained in:
jstaerk
2021-02-02 08:05:10 +01:00
parent 0763ade64e
commit e142a81959
13 changed files with 1679 additions and 9 deletions

View File

@@ -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)

View File

@@ -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);