What is the reason for the difference between these two urlencodings urls

Some UTF-8 encoded requests that I send to the server do not return wait results.

i.e

http://direct.jthinkws.com?type=release&query=artist%3A%28Dinosaur%7E0.7+AND+Jr.%29++AND++%28%2Btrack%3A%22Forget+The+Swan%22+%2Btrack % 3A% 22 Just + Like + Heaven% 22 +% 29 ++ AND + tracks% 3A% 5B2 + TO + 100% 5D ++ AND + src% 3A1 & limit = 20 & offset = 0

returns only two results (the results are returned as Xml) in my application and only 2 results if I put them directly in the Firefox browser

However, if I put the uncoded url value in Firefox

http://direct.jthinkws.com?type=release&query=artist: (Dinosaur ~ 0.7 and younger) And (+ track: "Forget the swan" + track: "Just Like Heaven") And tracks: [2 to 100] And src: 1 & limit = 20 & offset = 0

it returns 44 files

and from my server I see that I get the following request, which, I believe, should be firefox data encoding

http://direct.jthinkws.com?type=release&query=artist: (Dinosaur ~ 0.7% 20AND% 20Jr.)% 20% 20AND% 20% 20 (+ track: "Forget% 20the% 20Swan"% 20 + track: "Only% 20like% 20Heaven"% 20)% 20% 20and% 20tracks: [2% 20to% 20100]% 20% 20and% 20src: 1 & limit = 20 & offset = 0

as you can see, it encodes it a little differently - spaces are converted to "% 20", but not "+" and "(" and ")" are not converted.

, , , , , .

( ISO-8859-1 UTf-8), , , , UTf8 .

Java UREncoder, i.e

String query = URLEncoder.encode(queryValue.toString(), StandardCharsets.UTF_8.name());
+4
1

, , .

, Firefox +, . , Firefox, URL-, .

Firefox, , . , URL-, "+ ".

0

Source: https://habr.com/ru/post/1614134/


All Articles