A: 

htmlentities has a 3rd argument = the charset to use ie

htmlentities($string,ENT_COMPAT,"UTF-8");
Geek Num 88
A: 

I used the filter extension:

$url = filter_var($url, FILTER_SANITIZE_STRING, FILTER_FLAG_ENCODE_HIGH)

Before use it. This makes a better result than any other solutions I've tried (bcoz it's RFC compliant).

Dave