Answer the question
In order to leave comments, you need to log in
How can I override the encoding set in the HTTP header by the executed script using Apache 2?
There is a script that sets its charset in HTTP headers. This charset is not suitable for our needs, the script sets UTF-8, the content is encoded in Windows-1251, I can’t recode the content - other services will fall off. The script is maintained by a third party (opensource). In order to avoid problems during further updates, I would like to leave the script as it is and change the header using Apache 2. Is it possible?
I tried AddDefaultCharset, but the script interrupts this parameter.
Answer the question
In order to leave comments, you need to log in
If you just change the title, it will not give you anything. The content will remain in UTF-8. There is only one way out - to recode the response from UTF-8 to Windows-1251, and then use it for your needs.
Then there are the following options:
1. For the necessary files in the Apache config, try to set:
Header set Content-Type "text/html; charset=Windows-1251"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question