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

Encryption / decryption of HTML code or any text

On this topic:

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

On most sites, the 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 consider the source HTML code of their web projects as a commercial secret or "know-how".

To save your intellectual work from unauthorized use, this service will help with which you can quickly encrypt the source HTML code through javascript.

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

How to use?

  1. Paste your HTML / TEXT , which you want to encrypt into the form below.
  2. Pressing "CODE" will get your code / text in an encrypted form.
  3. Feel free to copy and paste it on your site.

  • "CODE" - encode the text / code.
  • "DECODE" - decode the encoded text / code encoded by this encoder.
  • "VIEW" - see the result of encoding in HTML format in a new window.
  • "SHARE" - 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 provided 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 the characters can be encoded with a single-byte number (codes within 0255) or two bytes (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? Open the MSIE submenu View -> Encodings 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 simplest option is when no code page or specific fonts are listed for the Web page. Then the browser will use the fonts selected by default. Since each user configures the program for himself and applies fonts with national alphabets, then problems with displaying domestic resources usually do not arise. Russian will read Russian, and German - German texts. If the page is downloaded from the Internet, then the problem can also be solved: the browser analyzes the page text and tries to find the necessary encoding. If he does it incorrectly, the user can always apply the above command and correct the situation.

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

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

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