Per https://www.php.net/manual/en/function.mb-convert-encoding.php, as of PHP 8.0.0, a ValueError is thrown if the value of `to_encoding` or `from_encoding` is an invalid encoding.
Thus first call `mb_list_encodings()` and `mb_encoding_aliases` to create an array with valid encodings, then compare wanted new encoding against all array keys (both in lower case) to check if the wanted new encoding is supported before passing it to `@mb_convert_encoding` but a ValueError is not suppressed by the stfu operator ("@").
No need to explicitly call `function_exist('mb_list_encodings')` as we just did this already for `mb_convert_encoding` also being part of the mbstring PHP extensionOrigin of the function:
https://secure.phabricator.com/rPHU72ad8fd0f05b0d84f7d8efd7db62ad0b3ba4431f
Premising that Arcanist elevates warnings to exception, now we just try-catch.
Closes T15423