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`.
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 extension.
Closes T15423