The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't get UTF-8 as default charset

Discussion in 'Security' started by dualmonitor, Jul 3, 2013.

  1. dualmonitor

    dualmonitor Active Member

    Joined:
    Dec 3, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello friends.

    I'm having a rough time making one of the sites I admin using cPanel to offer the HTTP header that reads:

    Content-Type: text/html; charset=utf-8

    No matter what changes I make, the site continues to offer:

    Content-Type: text/html; charset=iso-8859-1

    The funny part is that other sites I admin correctly offer utf-8 in the headers but one site just refuses to do so.

    I've read old threads like this one:

    http://forums.cpanel.net/f5/apache-charset-problem-74657.html

    ...but for the life of me none of the modifications I make seem to help.

    Does anyone have any suggestions? There must be one place I could evoke the change I haven't looked yet.
     
  2. kdean

    kdean Well-Known Member

    Joined:
    Oct 19, 2012
    Messages:
    262
    Likes Received:
    12
    Trophy Points:
    18
    Location:
    Orlando, FL
    cPanel Access Level:
    Root Administrator
    Is it being specified as a meta tag in the HEAD of the output HTML?

    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
     
  3. dualmonitor

    dualmonitor Active Member

    Joined:
    Dec 3, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Yes I do have

    <meta charset="utf-8" />

    in the HEAD of the output HTML.

    But in my particular use case, I need it to appear in the HTTP headers.
     
  4. kdean

    kdean Well-Known Member

    Joined:
    Oct 19, 2012
    Messages:
    262
    Likes Received:
    12
    Trophy Points:
    18
    Location:
    Orlando, FL
    cPanel Access Level:
    Root Administrator
    That should set it in the headers if you're using HTML 5. If not, try the longer…

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

    Also, check the .htaccess file to make sure the content-type and charset aren't being manipulated there as well.

    If that doesn't work, you may need to provide an actual link to your site so we can take a closer look.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,761
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can try adding the following line to the /usr/local/apache/conf/includes/pre_virtualhost_global.conf file:

    Code:
    AddDefaultCharset ISO-8859-1
    Then, restart Apache via:

    Code:
    # /scripts/restartsrv_httpd
    Thank you.
     
Loading...

Share This Page