module String:sig
..end
string
values.val encoding_guess : string -> [ `UTF_16BE | `UTF_16LE | `UTF_8 ] * bool
Note. Initial BOMs
are also folded over.
type'a
folder ='a -> int -> [ `Malformed of string | `Uchar of Uchar.t ] -> 'a
`Uchar
or `Malformed
starts.val fold_utf_8 : ?pos:int -> ?len:int -> 'a folder -> 'a -> string -> 'a
fold_utf_8 f a s ?pos ?len ()
is
f (
... (f (f a pos u
0) j
1 u
1)
... )
... )
j
n u
n
where u
i, j
i are characters and their start position
in the UTF-8 encoded substring s
starting at pos
and len
long. The default value for pos
is 0
and len
is
String.length s - pos
.val fold_utf_16be : ?pos:int -> ?len:int -> 'a folder -> 'a -> string -> 'a
fold_utf_16be f a s ?pos ?len ()
is
f (
... (f (f a pos u
0) j
1 u
1)
... )
... )
j
n u
n
where u
i, j
i are characters and their start position
in the UTF-8 encoded substring s
starting at pos
and len
long. The default value for pos
is 0
and len
is
String.length s - pos
.val fold_utf_16le : ?pos:int -> ?len:int -> 'a folder -> 'a -> string -> 'a
fold_utf_16le f a s ?pos ?len ()
is
f (
... (f (f a pos u
0) j
1 u
1)
... )
... )
j
n u
n
where u
i, j
i are characters and their start position
in the UTF-8 encoded substring s
starting at pos
and len
long. The default value for pos
is 0
and len
is
String.length s - pos
.