| Top |
High-level character encoding conversion functions.
If you need more flexibility, there are lower-level utilities:
GflsValidatedString * gfls_encoding_convert (GBytes *input_bytes,const GflsEncoding *from_encoding,const GflsEncoding *to_encoding,gboolean allow_invalid_bytes,gboolean *lossy_conversion,GError **error);
High-level function to convert a single GBytes.
[skip]
input_bytes |
the input GBytes. |
|
from_encoding |
source encoding. |
|
to_encoding |
destination encoding. |
|
allow_invalid_bytes |
whether to allow invalid bytes during the conversion. |
|
lossy_conversion |
whether
|
[out][optional] |
error |
location to a GError, or |
Since: 0.5
gboolean gfls_encoding_try_convert (GBytes *input_bytes,const gchar *to_codeset,const gchar *from_codeset);
Tries a conversion on input_bytes
, discarding the output.
from_codeset
and to_codeset
must be compatible with iconv, see
gfls_iconv_open().
If input_bytes
ends with an incomplete multi-byte character, that part is
ignored. So input_bytes
can be for example the first chunk of a file when
loading it.
TRUE if and only if input_bytes
can be converted without errors,
without invalid characters and without fallback characters.
Since: 0.4