Module Uutf.String
Fold over the characters of UTF encoded OCaml string values.
Encoding guess
val encoding_guess : string -> [ `UTF_8 | `UTF_16BE | `UTF_16LE ] * boolencoding_guess sis the encoding guessed forscoupled withtrueiff there's an initial BOM.
String folders
Note. Initial BOMs are also folded over.
type 'a folder= 'a -> int -> [ `Uchar of Stdlib.Uchar.t | `Malformed of string ] -> 'aThe type for character folders. The integer is the index in the string where the
`Ucharor`Malformedstarts.
val fold_utf_8 : ?pos:int -> ?len:int -> 'a folder -> 'a -> string -> 'afold_utf_8 f a s ?pos ?len ()isf (...(f (f a pos u0) j1u1)...)...) jnun whereui,ji are characters and their start position in the UTF-8 encoded substringsstarting atposandlenlong. The default value forposis0andlenisString.length s - pos.
val fold_utf_16be : ?pos:int -> ?len:int -> 'a folder -> 'a -> string -> 'afold_utf_16be f a s ?pos ?len ()isf (...(f (f a pos u0) j1u1)...)...) jnun whereui,ji are characters and their start position in the UTF-8 encoded substringsstarting atposandlenlong. The default value forposis0andlenisString.length s - pos.
val fold_utf_16le : ?pos:int -> ?len:int -> 'a folder -> 'a -> string -> 'afold_utf_16le f a s ?pos ?len ()isf (...(f (f a pos u0) j1u1)...)...) jnun whereui,ji are characters and their start position in the UTF-8 encoded substringsstarting atposandlenlong. The default value forposis0andlenisString.length s - pos.