| |

VerySource

 Forgot password?
 Register
Search
View: 1502|Reply: 6

Ask the question of Chinese character encoding

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-13 11:20:01
| Show all posts |Read mode
Ask you, in the http protocol (grabbed network data), how are Chinese characters encoded? I checked some information, and some said it was unicode, but I checked it and found that it is not. What kind of encoding method is used in the http protocol? Thank you!
Reply

Use magic Report

0

Threads

13

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-17 19:54:01
| Show all posts
Are you talking about URL encoding or form data encoding? The former is an encoding similar to% C3% A0 ****. I think that only binary data is converted into visible characters, and there is not necessarily a conversion encoding in it. reference:
http://web.dd81.com/club/viewthread.php?tid=68144&fpage=1&highlight=
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-18 17:27:01
| Show all posts
thank you for your reply.
I'm not talking about url encoding or form data encoding, but encoding in http data (network packets).

For example, how are the two Chinese characters "test" encoded in the http packet?
Reply

Use magic Report

0

Threads

13

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-19 20:18:01
| Show all posts
(The following is just my understanding. Don't blame me for being wrong, just give you some reference. If there is an error, don't say that I am misleading, if you have any doubt, you can try it out.)

There may be two parts in the http protocol: encoding and URL and FORM Data.
The former will appear in the GET command, and the latter will appear in the POST command.
I remember reading a CONTENT_LENGTH when processing the POST data, and then I could read the data of that length. According to this point of view, the data does not need additional encoding. In other words, the HTTP protocol itself does not encode the data at this time. What is the original encoding is what is transmitted to the server.

You can analyze the obtained POST data. According to the encoding characteristics of GB23112 and Unicode, you can basically know which Chinese encoding is used.
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-23 01:00:02
| Show all posts
Messing!
Reply

Use magic Report

1

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-1-25 21:09:01
| Show all posts
The default encoding of http is utf8
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 22:00:01
| Show all posts
It doesn't seem to be UTF8. It should be ANSI encoding.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list