aboutsummaryrefslogtreecommitdiff
path: root/UTF8.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2017-01-02 17:56:04 +0100
committerSébastien Dailly <sebastien@chimrod.com>2017-01-10 14:35:04 +0100
commit0d1f9ff76aa6df3f17edd2d73c76ab444fec8528 (patch)
treee6a628b78a08beb7fd9912c3f4b9bbdcee59c3c4 /UTF8.ml
parent444c0baa87b6edfb21c002bf9e079e10509ee0e9 (diff)
Corrected some issues with odf documents
Diffstat (limited to 'UTF8.ml')
-rwxr-xr-xUTF8.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/UTF8.ml b/UTF8.ml
index 33df5b4..4fa5eca 100755
--- a/UTF8.ml
+++ b/UTF8.ml
@@ -4,7 +4,11 @@ let empty = ""
let decode x = Text.decode x
-let encode x = Text.encode x
+let encode x =
+ try Some (Text.encode x)
+ with Text.Invalid (_, _) -> None
+
+let raw_encode x = Text.encode x
let from_utf8string x = x