/usr/lib/ocaml/lablgtk2/gutf8.mli is in liblablgtk2-ocaml-dev 2.18.3+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | (**************************************************************************)
(* Lablgtk *)
(* *)
(* This program is free software; you can redistribute it *)
(* and/or modify it under the terms of the GNU Library General *)
(* Public License as published by the Free Software Foundation *)
(* version 2, with the exception described in file COPYING which *)
(* comes with the library. *)
(* *)
(* This program is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU Library General Public License for more details. *)
(* *)
(* You should have received a copy of the GNU Library General *)
(* Public License along with this program; if not, write to the *)
(* Free Software Foundation, Inc., 59 Temple Place, Suite 330, *)
(* Boston, MA 02111-1307 USA *)
(* *)
(* *)
(**************************************************************************)
(* $Id$ *)
(** Pure ocaml module for conversion between UCS and UTF8 *)
type unichar = int
type unistring = unichar array
(** [from_unichar 0xiii] converts a code point [iii] (usually in hexadecimal
form) into a string containing the UTF-8 encoded character [0xiii]. See
{{:http://www.unicode.org/}unicode.org} for charmaps.
Does not check that the given code point is a valid unicode point. *)
val from_unichar : unichar -> string
val from_unistring : unistring -> string
(** [to_unichar_validated] decodes an UTF-8 encoded code point and checks
for incomplete characters, invalid characters and overlong encodings.
@raise Convert.Error if invalid *)
val to_unichar_validated : string -> pos:int ref -> unichar
(** [to_unichar] decodes an UTF-8 encoded code point. Result is undefined
if [pos] does not point to a valid UTF-8 encoded character. *)
val to_unichar : string -> pos:int ref -> unichar
(** [to_unistring] decodes an UTF-8 encoded string into an array of
[unichar]. The string {e must} be valid. *)
val to_unistring : string -> unistring
(** [first_char] returns the first UTF-8 encoded code point. *)
val first_char : string -> unichar
(** [next] returns the position of the code point following the one at [pos]. *)
val next : string -> pos:int -> int
(** [length] returns the number of code-points in the UTF-8 encode string *)
val length : string -> int
(** [to_unichar_validated] may raise [PARTIAL_INPUT] or [ILLEGAL_SEQUENCE] *)
module Error : sig
type error =
| NO_CONVERSION
(** Conversion between the requested character sets is not supported *)
| ILLEGAL_SEQUENCE (** Invalid byte sequence in conversion input *)
| FAILED (** Conversion failed for some reason *)
| PARTIAL_INPUT (** Partial character sequence at end of input *)
| BAD_URI (** URI is invalid *)
| NOT_ABSOLUTE_PATH (** Pathname is not an absolute path *)
exception Error of error * string
val raise_bad_utf8 : unit -> 'a
end
|