ICONVCTL(3)
iconvctl π
Library Functions Manual realness, bestie! okay so this page is all about iconvctl and how it lets you poke at the behavior of a conversion descriptor. No cap, it's giving very much "control room for iconv" energy. ποΈβ¨
β¨ NAME β¨
iconvctl β control iconv behavior. periodt. π
πΈ SYNOPSIS πΈ
#include <iconv.h>
int iconvctl (iconv_t cd , int request, void * argument);
π¦ DESCRIPTION π¦
okay so the cd argument has to be a conversion descriptor, and you get one of those by calling iconv_open. no random cd allowed, bestie. π«Ά
iconvctl queries or adjusts the behavior of the iconv function when it's invoked with that specified conversion descriptor. what exactly happens depends on the request value. it's giving "same descriptor, different vibe check" energy. π₯
π REQUEST VALUES π
The following are permissible values for the request parameter. get into it:
ICONV_TRIVIALPβargumentshould be anint *that will receive1if the conversion is trivial, or0otherwise. literally a yes/no moment. πICONV_GET_TRANSLITERATEβargumentshould be anint *that will receive1if transliteration is enabled in the conversion, or0otherwise. transliteration status check, slay. β¨ICONV_SET_TRANSLITERATEβargumentshould be aconst int *, pointing to anintvalue. a non-zero value is used to enable transliteration in the conversion. a zero value disables it. toggle time, bestie. πICONV_GET_DISCARD_INVALIDβargumentshould be anint *that will receive1if "discard invalid multibyte sequence from the input and continue" is enabled in the conversion, or0otherwise. πICONV_SET_DISCARD_INVALIDβargumentshould be aconst int *, pointing to anintvalue. a non-zero value is used to enable "discard invalid multibyte sequence from the input and continue" in the conversion. a zero value disables it. π«‘ICONV_GET_DISCARD_NON_IDENTICALβargumentshould be anint *that will receive1if "discard character that cannot be represented in the target character set and continue" is enabled in the conversion, or0otherwise. that's the vibe check for non-identical characters. π¦ICONV_SET_DISCARD_NON_IDENTICALβargumentshould be aconst int *, pointing to anintvalue. a non-zero value is used to enable "discard character that cannot be represented in the target character set and continue" in the conversion. a zero value disables it. πΈICONV_GET_DISCARD_ILSEQβargumentshould be anint *that will receive1if both "discard" behaviours are enabled in the conversion, or0otherwise. both, bestie. not one, not the other β both. πICONV_SET_DISCARD_ILSEQβargumentshould be aconst int *, pointing to anintvalue. a non-zero value is used to enable both "discard" behaviours in the conversion. a zero value disables them. double toggle energy. π₯ICONV_GET_FROM_SURFACEβargumentshould be anunsigned int *that will receive the from-side (input side) surface of the conversion. input-side surface reveal. πICONV_SET_FROM_SURFACEβargumentshould be aconst unsigned int *, pointing to anunsigned intvalue. this value is installed as the from-side (input side) surface of the conversion. the value is a bit mask. zero denotes no surface. the valueICONV_SURFACE_EBCDIC_ZOS_UNIXhas an effect on EBCDIC encodings: the EBCDIC newline0x15will get mapped to LF instead of NEL. iconic bit-mask behavior. π§ICONV_GET_TO_SURFACEβargumentshould be anunsigned int *that will receive the to-side (output side) surface of the conversion. output-side surface reveal. βICONV_SET_TO_SURFACEβargumentshould be aconst unsigned int *, pointing to anunsigned intvalue. this value is installed as the to-side (output side) surface of the conversion. the value is a bit mask. zero denotes no surface. the valueICONV_SURFACE_EBCDIC_ZOS_UNIXhas an effect on EBCDIC encodings: LF, instead of NEL, will get mapped to the EBCDIC newline0x15. another iconic bit-mask moment. π
π RETURN VALUE π
the iconvctl function returns 0 if it succeeds. in case of error, it sets errno and returns -1. so yeah, success is the 0 moment, error is the -1 plus errno situation. no cap. π
π₯ ERRORS π₯
The following errors can occur, among others:
EINVALβ the request is invalid. wrong request, bestie. that's a no from the conversion descriptor. π
π CONFORMING TO π
this function is implemented only in GNU libiconv and not in other iconv implementations. it is not backed by a standard. you can test for its presence through (_LIBICONV_VERSION >= 0x0108). iykyk. π
π SEE ALSO π
xoxo, GNU β December 15, 2024 πβ¨
π¦ where this page comes from
- arch rolling: libiconv 1.19-1 Β· LGPL-2.1-only AND GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms