aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-07-02 19:57:35 +0200
committerClombrong <cromblong@egregore.fun>2025-07-26 21:55:50 +0200
commit9ec1d14b1478cda9ee730e01b084249d1d1e4a54 (patch)
treebafff6966f81da79da7ef06e5c109a8ac50aaca6
parentda55fb529db908834f4910ca8da31537d2f20b95 (diff)
docs(jid): document utf8 functions
-rw-r--r--lib/jid.ml5
1 files changed, 5 insertions, 0 deletions
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