Encoding in your case is url encoding means replacing the spaces for example with %20.
The purpose of the encoding is the replacing of some character with their hex code so to make sure that the characters will be transmitted correctly as they are.
The escaping character allows the compiler to jump over the next character without checking it.
if you want to go to another line in java you concatenate your string with \n.
So the \ character is a key to an action and once you have written \n the compiler will go to another line while executing.
so the \ is an escaping characher.
if you need to print the " symbol inside a string you say: String t = "i want to print the \" character as is.";
with the usage of the \ character the compiler will not consider the " as end of string but as a normal character that will be printed like any other one.