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

Encrypt / decrypt html code or any text

On this topic:

Зашифровка/расшифровка 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 the finished web page.

However, some optimizers view the HTML source code of their web projects as a trade secret or know-how.

Save from unauthorized use of their intellectual work, help this service, with which you can quickly encrypt the source HTML code via javascript.

Encodes html or any text in java-script. Conveniently to hide any information (for example, from rips or e-mail protection from spam).

How to use?

  1. Paste your HTML / TEXT you want to encrypt into the form below.
  2. By clicking "ENCODE" get your code / text in encrypted form.
  3. Feel free to 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 coding in HTML format in a new window.
  • "SELECT" - select the code in the window with one click.
  • "CLEAR" - 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 foreseen for hypertext documents. The standard display mode is ISO Latin I (ISO 88591). 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 one-byte number (codes within 0255) or a two-byte number (065,535). In the first case, the charset attribute is required to use the national alphabet, since the same character codes can be interpreted differently for different code pages.

And what if the charset attribute is not specified? In MSIE, open the View -> Encodings submenu and check which code pages are available on your computer. Surely you will find the commands 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 a web page. Then the browser will use the fonts selected by default. Since each user sets up the program for himself and applies fonts with national alphabets, there is usually no problem with displaying domestic resources. Russian will read Russian, and German - German texts. If the page is loaded from the Internet, the problem can also be solved: the browser analyzes the text of the page and tries to find the necessary encoding. If he does this incorrectly, the user can always apply the above command and correct the situation.

If the document contains an indication of a specific code page, the choice of the font (in this case, a certain subset of characters that will serve to display the 128255 codes) will be predetermined. Codes 32127, that is, punctuation marks, numbers and letters of the Latin alphabet, are displayed in the overwhelming majority of cases correctly, and codes 128255 can be displayed in different ways. Usually 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 specified incorrectly. For example, when creating hypertext documents in MS Word or MS FrontPage Express, a charset = xxxxx type construction is automatically added to the page text, which does not allow using Cyrillic. In this case, you must correctly specify the value of the attribute: charset = windows1251 (or another, if you need another code page). If you look at the “branded” Russian sites on the Internet, you will find that most encoding switches offer two uses for Cyrillic: Windows and KOI8.

Why are there such difficulties when there is a Unicode system? The answer is simple: due to the desire of developers to ensure a comfortable working environment. Indeed, all standard programs are designed for single-byte representation of characters. And editing the HTML code is most convenient, just by typing characters from the keyboard. If the document uses Unicode encoding, then such tools as Notepad, Norton Commander or WordPad will not work with it, and you will have to stop with a hypertext editor. In this case, the Russian letter A will look like this in the “source” mode: A (in decimal encoding). This page will be difficult to read and edit. You may encounter a similar encoding if you type 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.