From 9ec1d14b1478cda9ee730e01b084249d1d1e4a54 Mon Sep 17 00:00:00 2001 From: Clombrong Date: Wed, 2 Jul 2025 19:57:35 +0200 Subject: docs(jid): document utf8 functions --- lib/jid.ml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/jid.ml b/lib/jid.ml index 4e58c5b..bbcd2a6 100644 --- a/lib/jid.ml +++ b/lib/jid.ml @@ -5,10 +5,15 @@ type t = { resourcepart : string option; } +(** Valid JID are all UTF8 code points, so an invalid JID will raise [InvalidUTF8]. *) exception InvalidUTF8 +(** A list of UTF8 code points, associated with their respective position. *) type uchars = (Uchar.t * int) list +(** [uchars_of_string s] is an [uchars] of the UTF8 characters of the string [s]. + + If an invalid UTF8 character, the functions raises an [InvalidUTF8] exception. *) let uchars_of_string s : uchars = let open Uchar in let len = String.length s in -- cgit v1.2.3