### Function

# EDataServer util_utf8_data_make_valid

since: 3.6

#### Declaration [src]

    gchar*
    e_util_utf8_data_make_valid (
      const gchar* data,
      gsize data_bytes
    )

#### Description [src]

Returns a newly-allocated NULL-terminated string with invalid characters replaced by Unicode replacement characters (U+FFFD). For `NULL` `data` returns newly allocated empty string (“”).

Available since: 3.6

#### Parameters

`data`

  Type: `const gchar*`

  UTF-8 binary data.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`data_bytes`

  Type: `gsize`

  Length of the binary data.

#### Return value

Type: `gchar*`

A newly-allocated string.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.