Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GIConv

[13:7] extends: object

The GIConv struct wraps an iconv() conversion descriptor. It contains private data and should only be accessed using the following functions.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GIConv (Handle = null)

    Creates a new IConv by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • Fn (string inbuf, int inbytes_left, string outbuf, int outbytes_left)

    Same as the standard UNIX routine iconv(), but may be implemented via libiconv on UNIX flavors that lack a native implementation. GLib provides g_convert() and g_locale_to_utf8() which are likely more convenient than the raw iconv wrappers. Note that the behaviour of iconv() for characters which are valid in the input character set, but which have no representation in the output character set, is implementation defined. This function may return success (with a positive number of non-reversible conversions as replacement characters were used), or it may return -1 and set an error such as %EILSEQ, in such a situation. See iconv(3posix) and iconv(3) for more details about behavior when an error occurs.

    • @p inbuf is bytes to convert.
    • @p inbytes_left is inout parameter, bytes remaining to convert in @inbuf.
    • @p outbuf is converted output bytes.
    • @p outbytes_left is inout parameter, bytes available to fill in @outbuf.
    • @r count of non-reversible conversions, or -1 on error.
  • close ()

    Same as the standard UNIX routine iconv_close(), but may be implemented via libiconv on UNIX flavors that lack a native implementation. Should be called to clean up the conversion descriptor from g_iconv_open() when you are done converting things. GLib provides g_convert() and g_locale_to_utf8() which are likely more convenient than the raw iconv wrappers.

    • @r -1 on error, 0 on success.