Commit 87ed85ae authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Revert to reading file with Latin1 encoding by default.

parent 83abca50
......@@ -142,7 +142,7 @@ let rec token enc lexbuf =
Cduce_loc.push_source (`File path);
try
let cs = Stream.of_channel ic in
let newenc = ref Utf8 in
let newenc = ref Latin1 in
(* or ref !enc ? *)
let newlb = mk_lexbuf newenc cs in
let past = pre_prog (token newenc newlb) in
......@@ -173,7 +173,7 @@ let get_loc lexbuf =
(loc1.Lexing.pos_cnum, loc2.Lexing.pos_cnum)
let protect_parser ?global_enc do_sync gram stream =
let enc = match global_enc with Some e -> e | None -> ref Utf8 in
let enc = match global_enc with Some e -> e | None -> ref Latin1 in
let b = mk_lexbuf enc stream in
try
let f = token enc b in
......@@ -201,7 +201,7 @@ let protect_parser ?global_enc do_sync gram stream =
let prog = protect_parser false pre_prog
let top_phrases =
protect_parser ~global_enc:(ref Utf8) true (for_sedlex Parser.top_phrases)
protect_parser ~global_enc:(ref Latin1) true (for_sedlex Parser.top_phrases)
let protect_exn f g =
try
......
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