default page encoding

Posted on 2006-04-04
Last Modified: 2010-03-04

This might not be an Apache question but I think it is so bear with me...thanks....

I have some web pages that are encoded with UTF-8.  I have set <meta http-equiv="Content-Type" content="text/html; charset=utf-8" > on the pages, but still the default encoding by the browser is ISO-8859-1, which causes some of the characters to display wrong.  if you manually change the encoding in Firefox or IE to UTF-8 the page reloads and we're all very happy, the characters all display right, etc.  

So how do I get this encoding to default for every browser?!  I'm assuming since I've set the meta tag in the HTML and it's still not working it's an Apache thing.  

Question by:bakum
    LVL 15

    Accepted Solution

    It may *be* an Apache thing.  See:

    which states:

    For Apache, this can be done via the AddCharset (Apache 1.3.10 and later) or AddType directives, for directories or individual resources (files). With AddDefaultCharset (Apache 1.3.12 and later), it is possible to set the default 'charset' for a whole server.

    Unfortunately, it also says:

    In theory, any character encoding that has been registered with IANA can be used, but there is no browser that understands all of them. The more widely a character encoding is used, the better the chance that a browser will understand it.


    Author Comment

    That was it.  I set up an .htaccess file where those utf-8 files are and set

    AddDefaultCharset Off

    did the trick.  Turns out that in most circumstances there should be no default charset set for Apache.  That this should be left to the HTML, generally.
    LVL 15

    Expert Comment

    Glad to have assisted!  Good luck with your site!

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Redirect URL's containing question marks 5 38
    HTTPS Redirect Problem 17 57
    Running Guacamole on port 80 5 74
    Ubuntu 14 with Apache 7 64
    Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now