Your code is correct, but a few code pages are not fully described in table TCP00A (Relationship between standardized name and SAP code page number). For instance, it would work with code page "iso-8859-1".

EDIT: the Eszett character is the Unicode character U+00DF. C39F is its code value in UTF-8. When you indicate an invalid or unknown encoding (in TCP00A), the encoding is ignored, so UTF-8 will be used with a rendering to an XSTRING variable.

That also explain to me the missing link between code page and character set.

Most characters are now correctly converted into the destination character set. Characters that are missing are converted into the missing conversion character which is '#' by default. That is all fine.

A next conversion in the 'nice to have category' would be a conversion of character Ë. Character Ë is not available in the destination character set. So it gets converted into #. Nice to have is to have it converted into E. Do you know this is possible ?