Skip to content

Commit e0733ff

Browse files
committed
rocqide when encoding is set to "LOCALE" always convert
UTF8 when converted to some locale may produce valid UTF8 but invalid Coq (ie some unicode character may become \uXXXX) Fix rocq-prover#11526
1 parent 4e8baf5 commit e0733ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ide/rocqide/ideutils.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ let do_convert s =
219219
Glib.Convert.convert s ~to_codeset:"UTF-8" ~from_codeset:enc
220220
in
221221
let s =
222-
if Glib.Utf8.validate s then (Minilib.log "Input is UTF-8"; s)
223-
else match encoding#get with
224-
|Preferences.Eutf8 | Preferences.Elocale -> from_loc ()
225-
|Emanual enc -> try from_manual enc with _ -> from_loc ()
222+
match encoding#get with
223+
| Eutf8 when Glib.Utf8.validate s -> (Minilib.log "Input is UTF-8"; s)
224+
| Eutf8 | Elocale -> from_loc ()
225+
| Emanual enc -> try from_manual enc with _ -> from_loc ()
226226
in
227227
Utf8_convert.f s
228228

0 commit comments

Comments
 (0)