Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to recognize coding

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to understand coding. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Recognition of coding methods: 1. Base64 is one of the most common coding methods used to transmit 8Bit bytecodes on the network. Base64 is a method to represent binary data based on 64 printable characters. 2. [UTF-8] is a variable length character coding for Unicode, also known as universal code.

The way to recognize coding:

The coding is mainly divided into two parts.

Base64 is one of the most common coding methods used to transmit 8Bit bytecode on the network. Base64 is a method to represent binary data based on 64 printable characters.

UTF-8 (8-bit Unicode Transformation Format) is a kind of variable length character coding for Unicode, also known as universal code. Founded by Ken Thompson in 1992. It has now been standardized to RFC 3629. UTF-8 encodes Unicode characters with 1 to 6 bytes. It can be used on the web page to unify the display of simplified Chinese and other languages (such as English, Japanese, Korean).

Utf-8 is a coding method of unicode (the character "I" unicode is encoded in\ u6211\ u to represent Chinese, and 6211 is the binary data of this character shown in hexadecimal in the comparison table). It is the expression of characters, such as what kind of binary expression what kind of character, there is a comparison table, base64 is easy to transmit binary coding, for example, you can encode the binary base64 of a picture by transmitting a picture. Pass parameters to other recipients, not the same concept

UrlEncode converts the characters that need to be transcoded into hexadecimal, and then takes 4 bits (less than 4 bits directly processed) from right to left, one bit for every 2 bits, preceded by%, and encodes into% XY format. (here also involves what kind of coding method to use, general utf-8, the coding method determines what kind of binary is converted, and then urlencode is converted to hexadecimal, adding% according to the rules.) the result of coding is more suitable for network transmission, just like base64, but base64 is only responsible for binary coding.

Urlencode coding / urldecode decoding

Convert the characters that need to be transcoded into hexadecimal (using unicode coding comparison table such as UTF-8 or gb2312), then from right to left, take 4 bits (less than 4 bits directly processed), do one bit for every 2 bits, add% in front, and encode into% XY format.

For example, if the space ASCII code is 32 and the corresponding hexadecimal code is 20, then the urlencode coding result is:% 20, but in the new standard, the space corresponds to +, see RFC-1738

For example, if the ASCII code is-10544 and the corresponding hexadecimal is FFFFFFFFFFFFD6D0, then the urlencode coding result is:% D6%D0

What code is used by the browser? when the server returns, it tells the browser what code to use (response.setContentType ("text/html;charset=UTF-8");). When requesting a request, the browser will also encode the content of this request, such as Chinese, according to the coding method returned last time.

On how to understand the code to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report