### Function

# GLib Variant new_bytestring

since: 2.26

#### Declaration

    GVariant*
    g_variant_new_bytestring (
      const gchar* string
    )

#### Description

Creates an array-of-bytes `GVariant` with the contents of `string`. This function is just like `g_variant_new_string()` except that the string need not be valid UTF-8.

The nul terminator character at the end of the string is stored in the array.

Available since: 2.26

#### Parameters

`string`

  Type: An array of `guint8`

  A normal nul-terminated string in no particular encoding.

  The array must be `NULL`-terminated.
  The data is owned by the caller of the function.

#### Return value

Type: `GVariant`

A floating reference to a new bytestring `GVariant` instance.

The data is owned by the called function.