M
M
Max1005002015-01-09 00:57:16
Character encoding
Max100500, 2015-01-09 00:57:16

What's wrong with the site text?

Can you tell me how this text came about?
kuplyu-kvartiry-kiev.ru/archives/1917

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aaron Ramsey, 2015-01-09
@szags

Problems in encoding. In 2 words - open the file in notepad++ and convert to utf-8 without BOM
In 3 words:
You are loading the database, and the encoding is displayed incorrectly in the database itself.
In this case, you need to delete all tables in the database, add the line
SET NAMES CP1251 to the beginning of the dump;
and reload.
If it didn't work out, then experiment with the encoding, for example, by writing SET NAMES UTF8; etc.
2. The encoding is correct in the database, but it is still not on the site.
a) the browser did not choose the encoding correctly. Try to change the encoding in the browser (View->Encoding), if by selecting one of the encodings, the site is displayed correctly, then you need to write the line "AddDefaultCharset encoding" in the root of the site in the .htaccess file (if there is no such file, then you need to create it). For example:
AddDefaultCharset UTF-8;
b) if all of the above did not help, then you need to look for a connection to the database (hereinafter referred to as the database) in the site and immediately after connecting to the database insert a string, for example:
mysql_query('set names utf8');
or with another encoding.
* For Zend Framework: in the application/configs/application.ini file, you must specify:
resources.db.params.charset = "UTF8"

A
Alexander Taratin, 2015-01-09
@Taraflex

The server sends in windows-1252 encoding, re-
save all files in utf8 since you are prescribing

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question