NOTE: it works on phpMyAdmin also works if i do this in country query LIKE '%"Šveice"%'
I have search bar in my website .If I try to find word “Šveice” (Šveice in Latvian = “Switzerland” in English) it will not find anything but if I try to search “veice” it will find it. All other letters are working.
This is what i got :
GET search
if (isset($_GET['query'])){
$query = htmlentities($_GET['query'], ENT_QUOTES, "UTF-8");
}
It did the trick back then but now it wont work and in url i get back query=Šveice instead of query=Šveice and even $_GET['query'] output is empty Please help me finally fix this issue!
Why didn’t you follow the tip you have been given on Stackoverflow?
What i did:
go to phpmyadmin, create a new database with colation utf8_latvian_ci, create a new table with colation utf8_latvian_ci, insert some words incl. yours
create a file, open it in Notepad++, set encoding to utf8 WITHOUT BOM, setting the utf8 header, create a new PDO instance with setting the charset and try a search