Преглед изворни кода

[eval] handle encoding in File.getContent

closes #7377
Simon Krajewski пре 7 година
родитељ
комит
07b38a2d35
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/macro/eval/evalStdLib.ml

+ 1 - 1
src/macro/eval/evalStdLib.ml

@@ -945,7 +945,7 @@ module StdFile = struct
 
 	let getContent = vfun1 (fun path ->
 		let path = decode_string path in
-		try encode_string (Std.input_file ~bin:true path) with Sys_error _ -> exc_string ("Could not read file " ^ path)
+		try bytes_to_utf8 (Bytes.unsafe_of_string ((Std.input_file ~bin:true path))) with Sys_error _ -> exc_string ("Could not read file " ^ path)
 	)
 
 	let read = vfun2 (fun path binary ->