src/Pure/PIDE/resources.scala
changeset 66918 ec2b50aeb0dd
parent 66917 fcf84cd6c94f
child 66959 015d47486fc8
--- a/src/Pure/PIDE/resources.scala	Wed Oct 25 14:36:29 2017 +0200
+++ b/src/Pure/PIDE/resources.scala	Wed Oct 25 14:39:22 2017 +0200
@@ -59,10 +59,11 @@
 
   def loaded_files(syntax: Outer_Syntax, name: Document.Node.Name): () => List[Path] =
   {
-    val raw_text = with_thy_reader(name, reader => reader.source.toString)
+    val (is_utf8, raw_text) =
+      with_thy_reader(name, reader => (Scan.reader_is_utf8(reader), reader.source.toString))
     () => {
       if (syntax.load_commands_in(raw_text)) {
-        val text = Symbol.decode(raw_text)
+        val text = Symbol.decode(Scan.reader_decode_utf8(is_utf8, raw_text))
         val spans = syntax.parse_spans(text)
         val dir = Path.explode(name.master_dir)
         spans.iterator.map(Command.span_files(syntax, _)._1).flatten.