Function url_encode_utf8 has utf8 in its name and indicates that it is working with UTF-8 (bytes). Also in documentation is written:
Returns a URL-encoded representation of $string in UTF-8 encoding as an octet string.
But in reality this function expects on its input Unicode $string and not input encoded in UTF-8.
Unicode string is a sequence of ordinals, where each represent one Unicode code point. On the other hand UTF-8 encoded input means sequence of bytes (0...255) and one Unicode code point is represented by one to up to 4 bytes.
So the function name and also in description is misleading.