package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.common/Glib/Convert/index.html

Module Glib.ConvertSource

Character Set Conversion

Sourcetype error =
  1. | NO_CONVERSION
    (*

    Conversion between character sets not supported

    *)
  2. | ILLEGAL_SEQUENCE
    (*

    Invalid byte sequence in conversion input

    *)
  3. | FAILED
    (*

    Conversion failed for some reason

    *)
  4. | PARTIAL_INPUT
    (*

    Partial character sequence at end of input

    *)
  5. | BAD_URI
    (*

    URI is invalid

    *)
  6. | NOT_ABSOLUTE_PATH
    (*

    Pathname is not an absolute path

    *)
Sourceexception Error of error * string

Exception raised when conversion fails

Sourceval convert : string -> to_codeset:string -> from_codeset:string -> string

convert str ~to_codeset ~from_codeset converts str from from_codeset to to_codeset.

  • raises Error

    if conversion fails

Sourceval locale_to_utf8 : string -> string

locale_to_utf8 str converts str from the current locale's encoding to UTF-8. If the locale is already UTF-8, validates and returns the string unmodified.

  • raises Error

    if conversion fails or string is invalid

Sourceval locale_from_utf8 : string -> string

locale_from_utf8 str converts str from UTF-8 to the current locale's encoding. If the locale is already UTF-8, validates and returns the string unmodified.

  • raises Error

    if conversion fails or string is invalid UTF-8

Sourceval filename_to_utf8 : string -> string

filename_to_utf8 filename converts a filename from the filesystem encoding to UTF-8.

  • raises Error

    if conversion fails

Sourceval filename_from_utf8 : string -> string

filename_from_utf8 filename converts a filename from UTF-8 to the filesystem encoding.

  • raises Error

    if conversion fails

Sourceval get_charset : unit -> bool * string

get_charset () returns (is_utf8, charset) where is_utf8 is true if the current locale uses UTF-8 encoding, and charset is the name of the character set.