LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to set Charset to UTF-8 in Apache for scripts? (https://www.linuxquestions.org/questions/linux-software-2/how-to-set-charset-to-utf-8-in-apache-for-scripts-642340/)

cooljai 05-15-2008 04:53 AM

How to set Charset to UTF-8 in Apache for scripts?
 
Hi,
I'm on CentOS 5 machine and thought changing default charset of 'ISO-8859-1' to 'UTF-8' is not a big deal in Apache 2.2, so I updated httpd.conf to have this line:
Code:

AddDefaultCharset UTF-8
Restarted Apache and open default page in Firefox:
Code:

http://serverip/
it showing good 'UTF-8'. Now when I try to run perl scripts:
Code:

http://serverip/cgi-bin/myscript.pl
it shows 'ISO-8859-1' charset instead of expected 'UTF-8' while checking from browser. We are not setting any specific config in perl and Apache should report Charset as 'UTF-8'.

How can I force Apache to set UTF-8 for all contents it serve, including perl scripts? Kindly suggest, I'm out of ideas...

Regards,


All times are GMT -5. The time now is 08:40 AM.