PHP reads the dot matrix data of Chinese characters

Source: Internet
Author: User
Tags character set ord

This article gives you a detailed account of the use of PHP to read the Chinese character of the lattice data method and examples, very practical, there is a need for small partners can refer to.

Problems encountered in the project:

How does PHP read the Chinese character's dot matrix data? To enter a paragraph of text, you can get the text of all the lattice code.

Workaround:

Chinese GB font 7,445 characters, of which 6,773 Chinese characters, including one-level Chinese characters, 3,755, two-grade Chinese characters 3,008. 2-byte (16-bit binary) encoding is used.

Location Code: GB GB2312 stipulates that all GB characters and symbols form a 94x94 matrix. In this phalanx, each row is called a "zone", and each column is called a "bit", so the Phalanx actually consists of a Chinese character set with 94 areas (0 1 to 94 respectively) and 94 digits in each region (the digits are 01 to 94 respectively). The area code of a Chinese character is composed of a simple combination of the region code and the digit number. In the location code of Chinese characters, the high two-bit is the area code, and the low two digit is the bit number. This shows that the location code and Chinese characters or symbols are one by one corresponding.

Inner code: Chinese characters in the code refers to the computer to represent the encoding of Chinese characters. The internal code is slightly different from the location code. At present, for most computer systems in China, the inner code of a Chinese character occupies two bytes, called High byte and low byte respectively, and the relationship between the two-bit byte and location code is as follows: Inside code high = region code +a0h (h for hexadecimal) inner code low = bit code +A0H For example, Chinese characters "ah" The location code is "1601″ , the region code and the bit code are "1001H" in hexadecimal notation respectively, then its inner code is "b0a1h". Where b0h is the high byte of the inner code, A1H is the low byte of the inner code.

Returns a string consisting of 0 and 1

?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 The

The above is the entire contents of this article, I hope you can enjoy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.