I am developing my own cms system, everything is almost ready, but there is one "but." The fact is that the system was originally written in cp1251 encoding, and then transferred to utf-8 (not only the meta tag changed, but also the encoding of the files).

The system is working on the ho.ua hosting, however, the encoding on the output is cp1251 and we see gibberies there (this is how the web server is configured). On the hosting 1gb.ru generally empty white page is returned (unfortunately I can not show). Here is a link how to work on a home computer.

If you have time and opportunity to look at the system, poke your nose into an error or help with the encoding, then I ask ... Here is a link to the archive with the system, to install, you need to unpack the archive first, and then install the access rights (0777) for the install_master file. php and open the install_wizard.html file and follow the installer instructions. And a couple more plugins for it:

  1. Polls
  2. Page rating (rating)
  • 2
    No, download and understand lazy, honestly. =) Possible reasons named. - knes

2 answers 2

In addition to the meta tag and file encoding, it is often necessary to specifically send a header with an encoding.

header("Content-type:text/html;charset=utf-8"); 

For example, on a masterhost without this line, 1251 is sent automatically. You also need to check the database encoding and, if necessary, make a SET NAMES query.

  • I sent the headers, did not help, tell the text of the SET NAMES query, and can I add it after the connection lines with the database, or can I replace it with the following? @mysql_query ("SET character_set_client = $ defaul_chars_4_base_connect"); @mysql_query ("SET character_set_connection = $ defaul_chars_4_base_connect"); @mysql_query ("SET character_set_results = $ defaul_chars_4_base_connect"); @mysql_set_charset ($ defaul_chars_4_base_connect); - Andrei Arshinov
  • The SET NAMES 'x' expression does the same thing as three consecutive ones: SET character_set_client = x; SET character_set_results = x; SET character_set_connection = x; So here you are all right. And in what encoding is the site displayed? This can be checked either by experiment, selecting the display encoding in the browser, or by driving it into any decoder - knes
  1. Apache is configured for win-1251 (in .htaccess add AddDefaultCharset utf-8)
  2. DB encoded in win-1251
  3. In any one file did not change the encoding.

Look like that's it.