Skip to content

Minilib.Text.Locale

Defined in minilib-text@0.7.0

Locale management functions.

To use the classification functions of wide characters, you should first initialize the locale by calling Locale::init_locale. For details, see the documentation of Minilib.Text.WideChar module.

Values

namespace Minilib.Text.Locale

get_locale

Type: Std::String -> Std::IO::IOFail Std::String

Queries the program's current locale.

This function is implemented by passing NULL pointer to the second argument of setlocale(3).

For details, see Linux manual page for setlocale(3).

Parameters
  • category_name: The name of the category. (For example, "LC_ALL", "LC_COLLATE", "LC_CTYPE", "LC_MESSAGES", "LC_MONETARY", "LC_NUMERIC", "LC_TIME")

init_locale

Type: Std::IO ()

Initialize the program's current locale.

This function is equivalent to setlocale(LC_ALL, "") in C language.

set_locale

Type: Std::String -> Std::String -> Std::IO::IOFail Std::String

Sets the program's current locale.

For details, see Linux manual page for setlocale(3).

Parameters
  • category_name: The name of the category. (For example, "LC_ALL", "LC_COLLATE", "LC_CTYPE", "LC_MESSAGES", "LC_MONETARY", "LC_NUMERIC", "LC_TIME")
  • locale: The locale to be set. (For example, "", "C", "en_US.UTF-8", "ja_JP.UTF-8")

Types and aliases

Traits and aliases

Trait implementations