The display process after Windows reads a text file

Source: Internet
Author: User

Windows first transforms the text data into the encoding format that it uses internally: Unicode, and then follows the Unicode of the text to find the font image in the font file, and finally displays the image to the window. Summarizing the previous analysis, the text should look like this:

  • Step 1: The text is first saved in a file with some kind of encoding.
  • Step 2:windows Map the text encoding in the file to Unicode.
  • Step 3:windows Find the font image in the font file according to Unicode, and draw it onto the window.

The so-called coding is to use numbers to denote characters, for example, "word" with d7d6. Of course, coding also means the convention , that is, everyone recognizes. From "Talking about Unicode encoding," We know that Unicode is also a type of text encoding, which is unique in that it is designed by international organizations and can accommodate all languages in the world. The text encoding we usually use is for a region of language, text design, only support specific language text. For example, in the example above, the file "Example GBK.txt" uses GBK encoding.

If an error occurs at any of the 3 steps above, the text cannot be displayed correctly, for example:

  • Error 1: If the code is mistaken, such as BIG5 encoded text as GBK encoding, there will be garbled.

  • Error 2: If a mapping from a specific encoding to Unicode has an error, such as a character not defined in the encoding scheme in the text data, Windows uses the default character, usually.

  • If the current font does not support the characters you want to display, Windows displays the default image in the font file: Blank or square.

Reference: http://www.fmddlmyy.cn/text16.html

The display process after Windows reads a text file

Related Article

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.