-
Notifications
You must be signed in to change notification settings - Fork 10
/
idn.mli
42 lines (31 loc) · 889 Bytes
/
idn.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(** Punycode & IDN *)
module type CONV =
sig
val upoints : string -> int array
val ustring : int array -> string
end
module Make(CONV : CONV) :
sig
exception Bad_input
exception Overflow
(** {1 punycode conversion} *)
val encode : string -> string
val decode : string -> string
(** {1 IDN conversion} *)
val encode_domain : string -> string
val decode_domain : string -> string
val self_test : unit -> unit
end
(*
module CONV_Netconversion =
struct
let upoints s = Netconversion.uarray_of_ustring `Enc_utf8 s
let ustring a = Netconversion.ustring_of_uarray `Enc_utf8 a
end
module CONV_Camomile =
struct
open CamomileLibraryDefault
let upoints s = Array.init (Camomile.UTF8.length s) (fun i -> Camomile.UChar.uint_code (Camomile.UTF8.get s i))
let ustring a = Camomile.UTF8.init (Array.length a) (fun i -> Camomile.UChar.chr_of_uint a.(i))
end
*)