### Method

# GLib Completion complete_utf8

deprecated: 2.26 since: 2.4

#### Declaration

    GList*
    g_completion_complete_utf8 (
      GCompletion* cmp,
      const gchar* prefix,
      gchar** new_prefix
    )

#### Description

Attempts to complete the string `prefix` using the `GCompletion` target items. In contrast to g_completion_complete(), this function returns the largest common prefix that is a valid UTF-8 string, omitting a possible common partial character.

You should use this function instead of `g_completion_complete()` if your items are UTF-8 strings.

Available since: 2.4

Deprecated since: 2.26

Rarely used API.

#### Parameters

`prefix`

  Type: `const gchar*`

  The prefix string, typically used by the user, which is compared with each of the items.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`new_prefix`

  Type: `gchar**`

  If non-`NULL`, returns the longest prefix which is common to all items that matched `prefix`, or `NULL` if no items matched `prefix`. This string should be freed when no longer needed.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: A list of `utf8`

The list of items whose strings begin with `prefix`. This should not be changed.

The data is owned by the instance.
Each element is a NUL terminated UTF-8 string.