I have a simple dashboard with items, and each item can have several tags. Now I'm implementing filtering functionality, when user clicks a tag, all item with that will be shown.
At the server side I'm rendering the webpage using JSTL <c:url />
with <c:param />
so in the source code it looks like this:
<a href="/dashboard?filter=k%c5%af%c5%88">kůň</a>
The problem is, that when I click the link, my browser actually decodes the string and it sends following to server: /dashboard?filter=kůň
The thing it, that this isn't valid URL so on the way over network it gets mangled and the server actually recieves /dashboard?filter=kůÅ
.
Everything on my webpage and server is set to use UTF-8. And this problem doesn't happen when using POST and sending UTF-8 data from form.
Is there any way to stop the browser from decoding the string?
I have tried Firefox and Chrome, but I don't think it's of any significance.
UPDATE: To clarify I want to recieve percent encoded string on my server, so I can safely decode it.
UPDATE2: I did some research on the letters, the problem is. That LATIN SMALL LETTER U WITH RING ABOVE
(ů) is encoded as two bytes - 0xC5 0xAF
. And Java treats each byte as single character. So 0xC5
becomes LATIN CAPITAL LETTER A WITH RING ABOVE
- Å. And so on.