mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
Merge branch 'freebsd-iconv' into 'main'
gconvert: match GNU iconv behaviour on FreeBSD See merge request GNOME/glib!3824
This commit is contained in:
commit
b8fba4ddb4
@ -73,8 +73,17 @@ try_conversion (const char *to_codeset,
|
|||||||
|
|
||||||
if (*cd == (iconv_t)-1 && errno == EINVAL)
|
if (*cd == (iconv_t)-1 && errno == EINVAL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
|
||||||
return TRUE;
|
#if defined(__FreeBSD__) && defined(ICONV_SET_ILSEQ_INVALID)
|
||||||
|
/* On FreeBSD request GNU iconv compatible handling of characters that cannot
|
||||||
|
* be repesented in the destination character set.
|
||||||
|
* See https://cgit.freebsd.org/src/commit/?id=7c5b23111c5fd1992047922d4247c4a1ce1bb6c3
|
||||||
|
*/
|
||||||
|
int value = 1;
|
||||||
|
if (iconvctl (*cd, ICONV_SET_ILSEQ_INVALID, &value) != 0)
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user