I am working on a webiste that translates an input string from Japanese to English.
This webiste has two text fields and one button to submit the string for translation.
But when I hit the button, I can see some kind of hexadecimal values separated by % in the address bar. I just want to know, are these haxadecimal values are the values of the input string and why they get seperated by %?
Is there any rule behind it that values seperated by spaces gets coverted to hexadeciaml and separated by %?
For ex- localhost/translator/?hl=ja#ja/en/%E6%9C%AC%E6%97%A5%E3%80%81%20%E3%83%97%E3%83%AC%EF%BC%95S%E3%83%91%E3%83%88%E3%83%AD%E3%83%BC%E3%83%AB%E5%AE%9F%E6%96%BD%E3%81%97%E3%81%BE%E3%81%99%2013%3A30%EF%BD%9E%E3%80%82%EF%BC%88%E6%9C%AC%E7%95%AA%EF%BC%9A6%2F17%EF%BC%88%E6%B0%B4%EF%BC%89
Looking forward to your answers.
What you are seeing is called URL Encoding. It allows characters that are not legal for a URL to be represented by only legal characters.
You are right, they are hex numbers.
For example, if you wanted to represent the
#
character in a URL parameter, you would use%23
to do so. If you just put the#
character in there, it would be interpreted as an anchor target on the page that was being requested, which would not be what you wanted.So what you are seeing is your form input being converted into these hex codes. Why, I'm not sure without seeing your code and the actual data you are putting in the form. You could avoid it by using a POST instead of a GET for that form action, though.