Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5cba00e9e6
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (21 sloc) 0.785 kb
* (c) 2004-2010 Anastasia Gornostaeva. <>
open Conversion
open Hooks
let unknown_encoding_handler encoding =
let decoder = Conversion.make_decoder encoding in
fun str i ->
match decoder str i with
| Cs.Shift j -> Xmlencoding.Shift j
| Cs.Invalid -> Xmlencoding.Invalid
| Cs.TooFew -> Xmlencoding.TooFew
| Cs.Result (j, ucs4) -> Xmlencoding.Result (j, ucs4)
let parse_document content =
Light_xml.parse_document ~unknown_encoding_handler content
let plugin opts =
let decoder_dir = List.assoc "path" (List.assoc "decoder_dir" opts) in
let encoder_dir = List.assoc "path" (List.assoc "encoder_dir" opts) in
Conversion.init ~decoder_dir ~encoder_dir ()
let _ =
Plugin.add_plugin "conversion" plugin
Jump to Line
Something went wrong with that request. Please try again.