I am trying to generate a query string. The function works for non utf8 characters, but utf8 characters show up as blank.
function
function qs_search($qs) {
parse_str($_SERVER['QUERY_STRING'], $query_string);
$query_string['search'] = basename($qs);
return http_build_query($query_string);
}
These are the results…
qs_search(‘regular’);
index.php?list&search=regular
qs_search(‘Синодальный’);
index.php?list&search=
As per the comments, I still have no idea why you’re using
basename, however, usingset_localewill work in PHP 5.2+:As stated, this will NOT work on PHP 5.0.0 – 5.1.6. Click to see results.
Edit:
Apparently the developers of Drupal had the same problem and created their own
basenamefunction because of this bug, and that should fix your issue on PHP 5.0.0 – 5.1.6.