UCS4 encoded string. The type is the bigarray of 32-bit integers. Bigarray.cma or Bigarray.cmxa must be linked when this module is used.
validate s
If s
is valid UCS4 then successes otherwise raises Malformed_code
.
Other functions assume strings are valid UCS4, so it is prudent
to test their validity for strings from untrusted origins.
All functions below assume strings are valid UCS4. If not, the result is unspecified.
Positions in the string represented by the number of characters
from the head.
The location of the first character is 0
next s i
returns the position of the head of the Unicode character
located immediately after i
.
If i
is a valid position, the function always success.
If i
is a valid position and there is no Unicode character after i
,
the position outside s
is returned.
If i
is not a valid position, the behaviour is undefined.
prev s i
returns the position of the head of the Unicode character
located immediately before i
.
If i
is a valid position, the function always success.
If i
is a valid position and there is no Unicode character before i
,
the position outside s
is returned.
If i
is not a valid position, the behaviour is undefined.