Transcoding problem

guys, I"d like to ask
String s = new String (content.getBytes ("GBK"));
and
String s = URLEncoder.encode (content, "GBK"); what"s the difference between the two?
Why is the receiver still garbled
after the first transcoding is used as a http request parameter, while the second is not garbled?

Mar.04,2021

1.URL coding (URL encoding), also known as percent coding (Percent-encoding), is a context-specific uniform resource locator (URL) encoding mechanism. The encoding that applies to the uniform resource identifier (URI) is also used to prepare data for the "application/x-www-form-urlencoded" MIME, because it is used to submit HTML form data through HTTP's request operation (request). -- baidu.wiki

2. Convert the characters that need to be transcoded into hexadecimal, then from right to left, take 4 bits (less than 4 bits directly processed), do one bit for every 2 bits, add% before it, and encode it into% XY format. And some characters need to be converted to other characters, such as''to + .
string- > GBK
URL- > application. (MIME)-> GBK

  1. java source

clipboard.png
clipboard.png

Menu