more checks;
authorwenzelm
Fri, 11 Sep 2020 13:54:22 +0200
changeset 72254 8c5b8d7999bd
parent 72253 1b01c626a441
child 72255 dc51115fa4aa
more checks;
src/Pure/Admin/check_sources.scala
--- a/src/Pure/Admin/check_sources.scala	Fri Sep 11 12:56:01 2020 +0200
+++ b/src/Pure/Admin/check_sources.scala	Fri Sep 11 13:54:22 2020 +0200
@@ -18,7 +18,12 @@
     if (space_explode('/', Word.lowercase(path.expand.drop_ext.implode)).contains("aux"))
       Output.warning("Illegal file-name on Windows" + Position.here(file_pos))
 
-    val content = File.read(path)
+    val bytes = Bytes.read(path)
+    val content = bytes.text
+
+    if (Bytes(content) != bytes) {
+      Output.warning("Bad UTF8 encoding" + Position.here(file_pos))
+    }
 
     for { (line, i) <- split_lines(content).iterator.zipWithIndex }
     {