新規作成  編集  Ruby-GNOME2 Project Website  ページ一覧  検索  更新履歴  編集履歴  RSS  ログイン

GLib

Module Functions

GLib.charset
Obtains the character set for the current locale; you might use this character set as an argument to GLib.convert, to convert from the current locale's encoding to some other encoding. (Frequently GLib.locale_to_utf8 and GLib.locale_from_utf8 are nice shortcuts, though.)
  • Returns: the character set name
GLib.convert(str, to_codeset, from_codeset)
Converts a string from one character set to another. If the conversion is not successful, it causes GLib::ConvertError.
  • str: the string to convert
  • to_codeset : name of character set into which to convert str
  • from_codeset : character set of str.
  • Returns: a newly string
GLib.locale_from_utf8(str)
Converts a string from UTF-8 to the encoding used for strings by the C runtime (usually the same as that used by the operating system) in the current locale. If the conversion is not successful, it causes GLib::ConvertError.
  • str: a UTF-8 encoded string
  • Returns: the converted string
GLib.locale_to_utf8(str)
Converts a string which is in the encoding used for strings by the C runtime (usually the same as that used by the operating system) in the current locale into a UTF-8 string. If the conversion is not successful, it causes GLib::ConvertError.
  • str: a string in the encoding of the current locale
  • Returns: the converted string
GLib.filename_from_utf8(str)
Converts a string from UTF-8 to the encoding used for filenames.
  • str: a UTF-8 encoded string
  • Returns: the converted string
GLib.filename_to_utf8(str)
Converts a string which is in the encoding used for filenames into a UTF-8 string. If the conversion is not successful, it causes GLib::ConvertError.
  • str: a string in the encoding for filenames
  • Returns: the converted string
GLib.filename_from_uri(uri)
Converts an escaped UTF-8 encoded URI to a local filename in the encoding used for filenames. If the conversion is not successful, it causes GLib::ConvertError.
  • uri: a uri describing a filename (escaped, encoded in UTF-8)
  • Returns: the resulting filename
GLib.filename_to_uri(filename, hostname = nil)
Converts an absolute filename to an escaped UTF-8 encoded URI.
  • filename: an absolute filename specified in the encoding used for filenames by the operating system.
  • hostname: a UTF-8 encoded hostname, or nil for none.
  • Returns: the resulting URI

Constants

MAJOR_VERSION
MICRO_VERSION
MINOR_VERSION
VERSION
= [major, micro, minor]

- Masao?