Differences between full-width and half-width input during typing

Source: Internet
Author: User

Ⅰ. What is fullwidth and halfwidth?
1. Fullwidth: a computer character. It refers to the position where a fullwidth character occupies two standard characters (or two halfwidth characters. The full angle occupies two bytes.

Chinese characters and the English characters that specify the full angle and the graphical symbols and special characters in the national standard GB2312-80 are all full-angle characters. In the fullwidth corner, letters, numbers, and other Chinese characters occupy the same width.

2. Halfwidth: a character occupies a standard character position. The half width occupies one byte.

The halfwidth is an ASCII character. When there is no Chinese character input method, the entered letters, numbers, and characters are halfwidth characters.

Prompt

Each half-width character occupies only one byte of space (one byte has 8 bits and a total of 256 encoding spaces ). The font size of image languages such as Chinese, Japanese, and Korean is much larger than 256 encoding spaces. Therefore, two bytes are used for storage. At the same time, due to the writing habits of Chinese, Japanese, and other hieroglyphics, full-angle characters are arranged neatly.

To arrange the characters neatly, the full-angle format is also provided for English and other Latin characters and punctuation.

II. Differences between fullwidth and halfwidth
Width and width are mainly for punctuation marks. Width and width occupy two bytes, and width occupies one byte. Both the half-width and full-width Chinese characters occupy two bytes.

III. Use of fullwidth and halfwidth
1. In the Chinese input method, the shortcut keys for switching full-width and half-width formats are SHIFT + space.

2. Generally, system commands do not use full-width characters. They only use full-width characters during text processing.

3. Only half-width punctuation can be used in the source code of the program. However, full-width or full-width punctuation can be used for data within the string.

4. Only halfwidth punctuation can be used on computers that do not support Chinese characters or other languages. In fact, in this case, there is no concept of full-width half-width.

5. In the Chinese character input method, the input letter and number are half-width by default, but the punctuation is full-width by default. As shown in the following figure:


The left part of the figure above is the default input status of the "five-stroke" Chinese character input method. This state is generally used for input when processing Chinese characters.

You can click the corresponding button on the toolbar of the input method to change the full-width and half-width states. The buttons on the left of the input method name "five pen type" change the Chinese and English input, the circle and the half circle on the right change the full or half angle of letters and numbers, and then the ".," Or "., "It is used to change the Chinese and English settings of punctuation marks (Chinese punctuation marks are full-width and English punctuation marks are half-width), and the rightmost keyboard icon is used to display the soft keyboard, you can enter special characters or letters in other languages.

Prompt

In our daily computer system, the default input method is the English input method. At this time, it is automatically in the halfwidth state. At this time, enter letters, symbols, or numbers, always occupies only one English character. If you switch to the Chinese input method, there will be two choices: full-width and half-width. For Chinese characters, these two options are not affected, and they always occupy the positions of two English characters, however, it is very important for the entered symbols, numbers, and English letters. After selecting the fullwidth, letters, symbols, and numbers must be processed as Chinese characters. From a visual perspective, they also seem awkward.

IV. Summary of fullwidth and halfwidth
1. When processing Chinese characters, Chinese characters and punctuation marks use full-width characters, and letters, other symbols, and numbers use half-width characters. That is, the default input status in the five font types is.

2. For English processing, such as English input, programming, email address, and website URL. All are processed in halfwidth mode.

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.