]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/utf8_macros/utf8Macro.ml
- addded unicode_of_tex
[helm.git] / helm / ocaml / utf8_macros / utf8Macro.ml
index 4e0bc9498992a7d14ef22b53992c6c7f5998eec8..51465046bec635f52dcc9428dfa5e9f6103bb122 100644 (file)
@@ -31,3 +31,10 @@ let expand macro =
     Hashtbl.find Utf8MacroTable.macro2utf8 macro
   with Not_found -> raise (Macro_not_found macro)
 
+let unicode_of_tex s =
+  try
+    if s.[0] = '\\' then
+      expand (String.sub s 1 (String.length s - 1))
+    else s
+  with Macro_not_found _ -> s
+