Why cannot PHP convert letters as ÆØÅ to lowercase æøå or uppercase when charset is UTF8?
Seem to apply ONLY if one of Æ Ø Å is first letter in string.
The problem occur when i search a database/tables UTF8_UNICODE_CI, with something as
SELECT DISTINCT id FROM TABLE WHERE 1 AND CONCAT(field_one,field_two,field_more,'') LIKE '%Øy%' AND ... ORDER BY ... DESC LIMIT 0 , 10;
The "Øy" gives result while "øy" give none results.
The same problem occur with german Ü and ü and many other letters. Searching e.g. "Bjørn" is OK tough....
Is the problem related PHP or MySQL or both?
What i have tested:
1) setlocale(LC_ALL, 'no_NO');
2) mb_strtoupper(); with MySQL query and tables as UPPER()
3) A First upper function:
function firstUpper($string)
{
$string = str_replace(array("Æ","Ø","Å"), array("æ","ø","å"), strtolower($string));
$ord = explode(" ", $string);
$return = "";
foreach ($ord as $val)
{
$return .= " " . str_replace(array("æ","ø","å"), array("Æ","Ø","Å"), strtoupper($val{0})) . substr($val,1,strlen($val)-1);
}
return $return;
}
4: mysql_query ("SET NAMES utf8");
When I search a Case-insensitive database, it sould not matter if the letters are "Å" or "å", or "M" is "m".
Strange... :xbones: :xbones: