Only alphanumerics and some special characters may be used in a URL (or URI, more on that difference elsewhere). This function will convert other characters to their Unicode values.
<?php utf8_uri_encode( $utf8_string, $length ) ?>
Since: 1.5.0
utf8_uri_encode() is located in wp-includes/formatting.php
.