This page has been robot translated, sorry for typos if any. Original content here.

Encrypt / decrypt HTML code or any text

Зашифровка/расшифровка HTML

On most sites, HTML code is publicly available, which means that any webmaster can easily reproduce it simply by looking at the screen of a finished web page. However, some optimizers view the HTML source code of their web projects as trade secrets or know-how.

To save your intellectual work from unauthorized use, this service will help, with the help of which you can quickly encrypt the source HTML code through javascript. It is convenient for hiding any information (for example, from rips or protecting e-mail from spam).

How to use?

The function encodes any text (HTML, XML, PHP, etc.) into a secret java-script.

  1. Paste your HTML / TEXT that you want to encrypt in the form below.
  2. By clicking "ENCODE" you will receive your code / text in encrypted form.
  3. Feel free to completely copy and paste it into your website.

  • "ENCODE" - encode text / code.
  • "DECODE" - decode the text / code encoded by this encoder.
  • “VIEW” - see the result of encoding in HTML format in a new window.
  • "SELECT" - select the code in the window with one click.
  • "CLEAN" - clear the code entry window.

I think there is no need to prove that the main language of the Internet is English. At the same time, the use of national alphabets is provided for hypertext documents. The standard display mode is ISO Latin I (ISO 88591) encoding. It is suitable for both MSDOS (ASCCII character set) and Windows, so the set of programs for viewing and editing HTML code is quite wide.

At the same time, browsers support the Unicode 2.0 character set (ISO10646), which allows the use of national alphabets. From a practical point of view, this means that characters can be encoded with a single-byte number (codes within 0255) or double-byte (065 535). In the first case, to use the national alphabet, the charset attribute is required, since the same character codes can be interpreted differently for different code pages.

But what if the charset attribute is not specified? Expand the View -> Encodings submenu in MSIE and check which code pages are available on your computer. Surely you will find teams responsible for displaying Russian letters: Cyrillic (Windows-1251) and / or Cyrillic (KOI8-R). These are the two most popular encodings in our country. The easiest option is when neither a code page nor specific fonts are specified for the Web page. Then the browser will use the default fonts. Since each user customizes the program for himself and uses fonts with national alphabets, there are usually no problems with displaying domestic resources. Russian will be read by Russians, and German by German texts. If the page is downloaded from the Internet, then the problem can also be solved: the browser analyzes the text of the page and tries to find the necessary encoding. If he does it wrong, the user can always apply the command mentioned above and correct the situation.

If the document contains an indication of a specific code page, the choice of font (in this case, a subset of the characters that will serve to display 128255 codes) will be predetermined. Codes 32127, that is, punctuation marks, numbers and letters of the Latin alphabet, are displayed in the vast majority of cases correctly, and codes 128255 can be displayed differently. Typically, programs support a large number of national alphabets. During the installation of the software, the necessary fonts are also automatically installed.

The problem most often occurs if the code page is entered incorrectly. For example, when creating hypertext documents in MS Word or MS FrontPage Express, a structure of the type charset = xxxxx is automatically added to the page text, which does not allow using the Cyrillic alphabet. In this case, you must correctly specify the attribute value: charset = windows1251 (or another, if you need a different code page). If you look at "branded" Russian sites on the Internet, you will find that most encoding switches offer two options for using the Cyrillic alphabet: Windows and KOI8.

Why are there such difficulties when the Unicode system exists? The answer is simple: because of the desire of developers to ensure comfortable working conditions. Indeed, all standard programs are designed for single-byte character representation. And editing HTML code is most convenient by simply entering characters from the keyboard. If the document uses Unicode encoding, then tools such as Notepad, Norton Commander or WordPad will not work with it, and you will have to stop at a hypertext editor. In this case, the Russian letter A will look like this in the “source” mode: A (decimal). Such a page will be difficult to read and edit. You may encounter a similar encoding if you type in the Cyrillic alphabet in a non-Russified hypertext editor. It can perform automatic character conversion. Therefore, each new editor should be tested for the possibility of using Russian letters: type a small text, save the document, and then view it in source mode.

On this topic: