Various items that work with text allow the user to specify the encoding, so that agent could convert it to UTF-8 first to uniformly process this text line-by-line.
If user makes an error and specifies an item with non-existing encoding like:
then iconv library will detect that this encoding is invalid, but Zabbix will ignore this error and simply return the text as it was already converted:
Same is for agent 2.
This would result zabbix treating lets say UTF-16 text as UTF-8.
Of course this would lead to various undesired behaviours.
Zabbix agents must not ignore the iconv_open() function -1 error code and make an item unsupported.
Issue was raised in ZBX-21547 , check subissues 1 and 4