Actually this function was failing for each and every string conversion during installation. I don't know if this may been related to the OS I used (Alpine Linux) or it is a bug existing anywhere else. The function was failing to convert a normal Ascii characters to UTF-8.
Researching on iconv it turned out to be an issue which exists for long time and well known in the PHP community, so the recommendation was to use mb_convert_encoding instead. This worked for me. I can try having a stock installation on Ubuntu and then see if this also fails, but I thought to share it with the community who may face similar issue.