About Windows Notepad garbled problem

Source: Internet
Author: User

Windows early is the ANSI character set, single-byte, that is, a Chinese (double-byte) text, in the Windows Simplified Chinese version of the display is Chinese, to the Windows Japanese version of the display do not know what is.

Now Windows supports Unicode, but what if it's text other than Unicode? is to allow a default language encoding, which is interpreted using the default language encoding when a string, not Unicode, is encountered.

In the regional and language options can change the default language, in different Windows language version is different, in the Simplified Chinese version, is GBK, in the traditional Chinese version, is BIG5, in the Japanese version is Shift-jis

And notepad ANSI code, is this default encoding, so, a Chinese text, with the ANSI code to save, in the Chinese version of the code is GBK mode save, to the traditional Chinese version, with the BIG5 read, it is all messed up.

Notepad is also not reconciled to this, so it wants to support Unicode, but there is a problem, a binary encoding, how to determine whether it is GBK or BIG5 or utf-16/utf-8? Notepad does this by saving a label at the front of the TXT file,

If Notepad opens a txt and finds this tag, it means Unicode. The label is called BOM, if it is 0xFF 0xFE, is Utf16le, if 0xFE 0xFF is utf16be, if it is 0xEF 0xBB 0xBF, it is UTF-8.

Without these three things, it is ANSI, which is interpreted using the default language encoding of the operating system.

The advantage of Unicode is that it displays correctly regardless of which language version of your TXT is placed on Windows. ANSI encoding is not. (UTF-8 the advantage is in the network environment, compared to save traffic, after all, the network of English data is the most)

About Windows Notepad garbled problem

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.