I have a little problem, for example I add a link in database who contain some characters like: é, á, ą and other like these. Now, my problem is when I want to select from database this link, on database these characters are automatically encoded (utf8), but when I want to select something like
SELECT * FROM `table` WHERE `link`='http://tést.tld'
don’t work, because in my database é was encoded. What can I do here?
I don’t know how to explain more exactly, I hope you understand what I need.
You are passing an invalid URI in your query:
URIs do only consist of US-ASCII letters,
éis not of such. You either store it wrong, but most certainly you might have over-seen that you need to get the PUNY-CODE/proper url-encoding for that URI.How are you storing these URIs into your database? As valid URIs or just as UTF-8?
Edit:
You store the utf-8 byte-sequences urlencoded into the database. You need to split the URI you’re looking for into it’s parts, encode the parts accordingly (e.g. urlencoding for the path part, puny-code for the domain name), re-build the full URI and search for it within your database.