Permalink
Browse files

[fix] unicode detection: try LANG if LC_CTYPE not defined

  • Loading branch information...
1 parent b28a60c commit b5ff2254f92df6556998b18d525cc131f67748d2 François-Régis Sinot committed Sep 12, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 opalang/opaParser.ml
View
@@ -156,7 +156,9 @@ let get_index_N_lines_after s i nl =
let parse_error_flag =
let search_for = Str.regexp "\\b[Uu][Tt][Ff]-?8\\b" in
- try let _ = Str.search_forward search_for (Sys.getenv "LC_CTYPE") 0 in ""
+ try
+ let lang = try Sys.getenv "LC_CTYPE" with Not_found -> Sys.getenv "LANG" in
+ let _ = Str.search_forward search_for lang 0 in ""
with Not_found -> "-->"
(* FIXME, use FilePos for obtaining citations etc. *)

0 comments on commit b5ff225

Please sign in to comment.