sig
  exception Invalid_char
  val str_encode : string -> string
  val str_decode : string -> string
  val encode : 'IO.output -> 'IO.output
  val decode : IO.input -> IO.input
end