Home > Back-end >  I wrote a server, and then write a form in the HTML. Then through the form of the web page data sent
I wrote a server, and then write a form in the HTML. Then through the form of the web page data sent

Time:09-23

I wrote a server, and then written in HTML form, and then through the form of the web page data sent to the server, the server read the web page is the data returned is a string of gibberish w...

CodePudding user response:

The t is read? ? & ? ,? +? 0?/? $? #? (? '?
? ?? ? ?=& lt; 5/
\
# HHTTP/1.1?

CodePudding user response:

As long as the garbled words, must be encoded inconsistent,
Data must be a byte of a byte transfer, and "Chinese characters" this two word with GBK code and then pass is 6 bytes, use utf8 encoding after the transfer is 4 bytes, the server at this time, after receipt of these bytes will be very confused, don't know if it is GBK or utf8, so as long as you give him to specify what kind of coding, garbled nature,

CodePudding user response:

HTML is specified in the utf-8 encoding, the server receives the data set utf-8 encoding

CodePudding user response:

refer to stumble into a man of all ages 2 floor response:
as long as the garbled words, must have been caused by inconsistent coding,
Data must be a byte of a byte transfer, and "Chinese characters" this two word with GBK code and then pass is 6 bytes, use utf8 encoding after the transfer is 4 bytes, the server at this time, after receipt of these bytes will be very confused, don't know if it is GBK or utf8, so as long as you give him to specify what kind of coding, garbled nature,
set, is still not solved, I have found the problem is the JDK native code do not match the encoding and the server, no

CodePudding user response:

reference 3 floor also night reply:
HTML specified in utf-8 encoding, the server receives data set utf-8
set, there is no effect, the problem is that the JDK native code do not match the encoding and the server, no
  • Related