Answer the question
In order to leave comments, you need to log in
How to fix encoding in AJAX? "Static" given in the correct encoding?
In standard Wordpress, when adding an entry (ajax request), the entry is displayed with cracks (incorrect encoding, see screenshot, after refreshing the page, the encoding becomes normal. See screenshot2
adding to .htaccess
AddDefaultCharset utf-8
AddType "text/html; charset=utf-8" . html
does not solve the problem, the encoding is wrong only for AJAX requests.
Answer the question
In order to leave comments, you need to log in
1. check the Apache encoding
2. check the encoding of the page itself and the files where the source codes are located
3. check the encoding of the page itself by setting it by force or by checking that the browser has set it exactly
4. check the encoding of the file that sends the ajax request
You can explicitly specify the encoding for an ajax request from jquery in the parameters of the ajax function
scriptCharset: "utf-8"
I checked that the page is rendered in utf-8, which is understandable, since after updating it with F5 everything falls into place, but it’s the AJAX response in
Connection:keep-alive
Content-Type:text/xml;charset=windows-1251
Date: Thu, 26 Jul 2012 15:44:07 GMT
Server:nginx/1.0.6
Added to .htaccess
AddType "text/xml; charset=utf-8" .xml
didn't help
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question