GUtf8InputStream

GUtf8InputStream — Input Stream performing UTF8 validation

Synopsis

#include <gio/gio.h>

                    GUtf8InputStream;
GInputStream *      g_utf8_input_stream_new             (GInputStream *base_stream);

Object Hierarchy

  GObject
   +----GInputStream
         +----GFilterInputStream
               +----GUtf8InputStream

Description

utf8 input stream implements GFilterInputStream and provides UTF8 validation of the data read from a the stream. If the supplied buffer is long enough (see below), the returned data is guaranteed to end at utf8 character boundaries.

Note

Extra care must be taken when performing "small" reads: unless you have control of the data being read, you need to always supply a buffer long at least 6 bytes, otherwise the returned content may be an incomplete utf8 byte sequence.

To create an utf8 input stream, use g_utf8_input_stream_new().

Details

GUtf8InputStream

typedef struct _GUtf8InputStream GUtf8InputStream;

An implementation of GFilterInputStream that performs UTF8 validation.

Since 2.24


g_utf8_input_stream_new ()

GInputStream *      g_utf8_input_stream_new             (GInputStream *base_stream);

Creates a new GUtf8InputStream from the given base_stream.

base_stream :

a GInputStream.

Returns :

a GInputStream for the given base_stream.

Since 2.24

See Also

GFilterInputStream, GInputStream