MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit c9069a0d authored by MARCHE Claude's avatar MARCHE Claude
Browse files

why3ide: Fix loading of non UTF8 source files

parent a5443911
......@@ -133,13 +133,29 @@ let (why_lang, any_lang) =
| Some _ as l -> l in
(why_lang, any_lang)
(* Borrowed from Frama-C src/gui/source_manager.ml:
Try to convert a source file either as UTF-8 or as locale. *)
let try_convert s =
try
if Glib.Utf8.validate s then s else Glib.Convert.locale_to_utf8 s
with Glib.Convert.Error _ ->
try
Glib.Convert.convert_with_fallback
~fallback:"#neither UTF-8 nor locale nor ISO-8859-15#"
~to_codeset:"UTF-8"
~from_codeset:"ISO_8859-15"
s
with Glib.Convert.Error _ as e -> Printexc.to_string e
let source_text fname =
let ic = open_in fname in
let size = in_channel_length ic in
let buf = String.create size in
really_input ic buf 0 size;
close_in ic;
buf
try_convert buf
(********************************)
(* loading WhyIDE configuration *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment