JavaScript converts Unicode encoding to Chinese

Source: Internet
Author: User
Tags uppercase letter

Var

The following methods are commonly used in the conversion of such data to Chinese issues.

1. Eval parsing or new Function ("' + str + ')" ()

// "I am a Unicode encoding"

2. Unescape parsing

// "I am a Unicode encoding"

Unicode Mini-Encyclopedia:

In the field of computer science, Unicode (Uniform Code, universal Code, single code, standard universal Code) is a standard in the industry, it can enable the computer to present the world's dozens of kinds of text system. Unicode is developed on the basis of the universal Character set (Universal Character set) and is also in the form of books (the Unicode Standard, currently fifth edition published by Addison-wesley Professional , isbn-10:0321480910) published externally. Unicode contains more than 100,000 characters (in 2005, the 100,000th character of Unicode is adopted and recognized as one of the criteria), a set of code diagrams that can be used as a visual reference, a set of coding methods and a set of standard character encodings, a set of characters including superscript, subscript, and so on.

The Unicode organization (the Unicode Consortium) is operated by a non-profit organization and dominates the subsequent development of Unicode, with the goal of replacing the existing character encoding scheme with a Unicode encoding scheme, In particular, the existing programmes in the multilingual environment, there are only limited space and incompatible problems.

The success of Unicode in the recognition of character sets enables it to be widely and highly advantageous in the field of internationalization and localization of computer software. This standard has been adopted in a variety of new technologies in recent years, including extensible Labeling Language (XML), the Java programming language, and the latest operating systems.

Encoding rules for Unicode encoding

For example, to encode "Yang", we can create a new Notepad, enter "Yang" Save as a Unicode encoding, and then view the file binary content, the previous FF fe two bytes is the Unicode encoded file header flag, followed by the 68 672 bytes is "yang" Unicode encoding, The conversion of the calculator to decimal is 26472, you can now write "Yang" in an HTML file, ie opens to show a "yang" word.

Of course, for a generic ASCII code, Unicode encoding is consistent with ASCII encoding, so a can display an uppercase letter "a".

JavaScript converts Unicode encoding to Chinese (go)

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.