How to change the code page

How to change the code page

When loading the page of the website the browser accepts a set of information including data on the code page determining language display options. Usually code page is set during creation of the website, but sometimes there is a need to change it on already working resource.

Instruction

1. Code pages are necessary for support of different languages, at the same time each page has the number. For example, to Cyrillics there correspond encodings Windows 1251, KOI8-R, KOI8-RU, ISO8859-5, DOS 866. From them the greatest distribution on the Internet was received by the first. The codings have also other languages.

2. Considering that there is a lot of languages, former codings at some point began not to be enough, they were not too convenient. Therefore in 1991 the Consortium of Unicode non-profit organization offered the new option of coding allowing to provide alphabets of practically all existing languages. The code received the name Unicode.

3. Unicode has several options of representation, UTF-8 became the most known. On the Internet it began to succeed former codings gradually. The advantage of Unicode is that you, having visited the page, will never see a set of unclear characters instead of letters. Characters in UTF-8 encoding are correctly displayed on computers with any language. Sometimes the term "Unicode" is used as a synonym of the UTF-16 encoding used in interfaces of Windows.

4. As on resources of RuNet also users of other countries come, replacement of old codings on new became rather relevant. The wrong display of the text forces the user to leave a resource that negatively affects its popularity. For change of page encoding open it in the Dreamweaver program. Select the Change menu - "Properties of the page". In the opened window select the Name/coding item, set Unicode (UTF-8) encoding and click okB the Include the Signature of Unicode (BOM) field the tick is not put. Change so all pages of the website.

5. If your website is placed on the Apache Web server (these data are in reference materials of a hosting), follows in the Notepad program ++ to create the text file .htaccess (at the beginning the end is put). It becomes so: open Notepad ++, select "File" - "New". Enter in it the next line: AddDefaultCharset <UserJS-USH-highlight tabindex= "" 0"" iID= "" 1"" of on= "" of style= "" background-attachment: scroll; background-repeat: repeat; background-position: 0% of 0%; background-image: none; background-color: #ff66ff"" term= "" 4""> utf-8 </UserJS-USH-highlight>. If this file already is, just add to it the specified line.

6. Now click "Codings" - "Transform to the UNIX-FORMAT". Close the program, the request for saving will appear. Confirm saving, select the place for it. Specify the name of the .htaccess file, a file type leave All types (*. *) and click "Save". Now load this file into a root directory of the website – there where there is a file of the homepage.

7. If the website uses databases, it is necessary to add to the PHP code of connection to a DB before the closing tag?> this line: @mysql_query (""SET NAMES' <UserJS-USH-highlight tabindex= "" 0" "iID= "" 1"" of on= "" of style= "" background-attachment: scroll; background-repeat: repeat; background-position: 0% of 0%; background-image: none; background-color: #ff66ff" "term= "" 4""> utf8 </UserJS-USH-highlight>'"");

8. Translation of site into UTF-8 encoding can bring different problems therefore work with the copy of the website. Replace the main pages changed only after make sure that everything works. If necessary look for the reference materials describing your situation in network.

Author: «MirrorInfo» Dream Team


Print