unison

Fork of Unison, a bi-directional file synchronization tool
git clone git://git.laack.co/unison.git
Log | Files | Refs | README | LICENSE

unicode.mli (1730B)


      1 (* Unison file synchronizer: src/unicode.mli *)
      2 (* Copyright 1999-2020, Benjamin C. Pierce (see COPYING for details) *)
      3 
      4 exception Invalid
      5 
      6 (* Case-insensitive comparison.  If two strings are equal according to
      7    Mac OS X (Darwin, actually, but the algorithm has hopefully
      8    remained unchanged) or Windows (Samba), then this function returns 0 *)
      9 val case_insensitive_compare : string -> string -> int
     10 
     11 (* Corresponding normalization *)
     12 val normalize : string -> string
     13 
     14 (* Case-sensitive comparison (but up to decomposition). *)
     15 val case_sensitive_compare : string -> string -> int
     16 
     17 (* Compose Unicode strings.  This is the decomposition performed
     18    by Mac OS X. *)
     19 val decompose : string -> string
     20 
     21 (* Compose Unicode strings.  This reverts the decomposition performed
     22    by Mac OS X. *)
     23 val compose : string -> string
     24 
     25 (* Convert to and from a null-terminated little-endian UTF-16 string *)
     26 (* Do not fail on isolated surrogate but rather generate ill-formed
     27    UTF-8 characters, so that the conversion never fails. *)
     28 val to_utf_16 : string -> string
     29 val from_utf_16 : string -> string
     30 
     31 (* Convert to and from a null-terminated little-endian UTF-16 string *)
     32 (* Invalid NTFS characters are mapped to characters in the unicode
     33    private use area *)
     34 (* FIX: not correct at the moment: should deal properly with paths such as
     35    //?/foo/   c:\foo\bar   ... *)
     36 val to_utf_16_filename : string -> string
     37 val from_utf_16_filename : string -> string
     38 
     39 (* Check whether the string contains only well-formed UTF-8 characters *)
     40 val check_utf_8 : string -> bool
     41 
     42 (* Convert a string to UTF-8 by keeping all UTF-8 characters unchanged
     43    and considering all other characters as ISO 8859-1 characters *)
     44 val protect : string -> string