From ef312564ca84a2b49fc291434d8fb2f8501bb618 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 15 Nov 2016 13:00:01 +0100 Subject: Initial commit --- UTF8.ml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 UTF8.ml (limited to 'UTF8.ml') diff --git a/UTF8.ml b/UTF8.ml new file mode 100755 index 0000000..33df5b4 --- /dev/null +++ b/UTF8.ml @@ -0,0 +1,36 @@ +include Text + +let empty = "" + +let decode x = Text.decode x + +let encode x = Text.encode x + +let from_utf8string x = x + +let to_utf8string x = x + +let trim x = Text.strip x + +let split str ~sep = + match Text.split ~max:1 ~sep str with + | [] -> "" + | hd::tl -> hd + +module Buffer = struct + + include Buffer + + type buffer = t + + let add_char b c = Uchar.of_char c + |> Uchar.to_int + |> Text.char + |> Buffer.add_string b +end + +module Printf = struct + + include Printf + +end -- cgit v1.2.3