In general, the problem is that when I have data from the database loaded by the AJAX, they are outputted by short messages, if I request a file directly, then I get the answer in a normal form, and when I do that, then I have the pff .. Here is the code of all the files that are used. When connecting to the database, I specify the encoding in which the data should come.
$charset = "cp1251"; mysql_set_charset($charset, $dblink); I also specify the encoding in the script
$.ajax({ url: file+".php", cache: false, scriptCharset: "cp1251", success: function(data){ $(".body").html(data); All data in the database is also recorded in cp1251 encoding, all scripts and phpshniki are also in cp1251 encoding. What to do, now I almost will not hang.