Top | ![]() |
![]() |
![]() |
![]() |
void | camel_utf8_putc () |
guint32 | camel_utf8_getc () |
guint32 | camel_utf8_getc_limit () |
gchar * | camel_utf7_utf8 () |
gchar * | camel_utf8_utf7 () |
gchar * | camel_utf8_ucs2 () |
gchar * | camel_ucs2_utf8 () |
gchar * | camel_utf8_make_valid () |
gchar * | camel_utf8_make_valid_len () |
void camel_utf8_putc (guchar **ptr
,guint32 c
);
Output a 32 bit unicode character as UTF-8 octets. At most 4 octets will
be written to ptr
. The ptr
will be advanced to the next character position.
guint32
camel_utf8_getc (const guchar **ptr
);
Get a Unicode character from a UTF-8 stream. ptr
will be advanced
to the next character position. Invalid utf8 characters will be
silently skipped. The ptr
should point to a NUL terminated array.
guint32 camel_utf8_getc_limit (const guchar **ptr
,const guchar *end
);
Get the next UTF-8 gchar at ptr
, and return it, advancing ptr
to
the next character. If end
is reached before a full UTF-8
character can be read, then the invalid Unicode gchar 0xffff is
returned as a sentinel (Unicode 3.1, section 2.7), and ptr
is not
advanced.
ptr |
a pointer to read the character from. |
[inout] |
end |
upper limit for the read, must not be |
gchar *
camel_utf7_utf8 (const gchar *ptr
);
Convert a modified UTF-7 string to UTF-8. If the UTF-7 string contains 8 bit characters, they are treated as iso-8859-1.
The IMAP rules [rfc2060] are used in the UTF-7 encoding.
gchar *
camel_utf8_utf7 (const gchar *ptr
);
Convert a UTF-8 string to a modified UTF-7 format.
The IMAP rules [rfc2060] are used in the UTF-7 encoding.
gchar *
camel_utf8_ucs2 (const gchar *ptr
);
Convert a UTF-8 string into a ucs2 one. The ucs string will be in
network byte order, and terminated with a 16-bit NULL
.
gchar *
camel_ucs2_utf8 (const gchar *ptr
);
Convert a ucs2 string into a UTF-8 one. The ucs2 string is treated
as network byte ordered, and terminated with a 16-bit NULL
.
gchar *
camel_utf8_make_valid (const gchar *text
);
Ensures the returned text will be valid UTF-8 string, with incorrect letters changed to question marks.
Valid UTF-8 string, with replaced incorrect letters.
Free it with g_free()
, when no longer needed.
[transfer full]
Since: 2.26
gchar * camel_utf8_make_valid_len (const gchar *text
,gssize text_len
);
Ensures the returned text will be valid UTF-8 string, with incorrect letters changed to question marks.
Valid UTF-8 string, with replaced incorrect letters.
Free it with g_free()
, when no longer needed.
[transfer full]
Since: 3.34