Get a free trial // Grow your CSS skills // Land your dream job

Force charset utf-8

Last updated on:

If you can not change the configuration of Apache server, use this code to force decoding of page to utf-8.

AddDefaultCharset utf-8

Reference URL


  1. ramakrishnan
    Permalink to comment#

    hi dude, i am following your contents since 6 months, every thing is amazing………..

    i have one issue!!!

    i am creating web using tamil font (south indian language) in that i am using ajax in addvance search to get the data from db, ajax is working gr8 but fonts are not coming its comes like box symbol i have worked with character sets and other aspects too…..

    please help me to solve the issue.

  2. Marco
    Permalink to comment#

    not working

  3. Mohamed Yahia
    Permalink to comment#

    UTF inside HTML code is better always ..

  4. Vitor
    Permalink to comment#

    With me works excelent :)

    Very very good

  5. Carl
    Permalink to comment#

    Pefect for “PageSpeed Insights”

    Add this in .htaccess: AddDefaultCharset utf-8

Leave a Comment

Posting Code

We highly encourage you to post problematic HTML/CSS/JavaScript over on CodePen and include the link in your post. It's much easier to see, understand, and help with when you do that.

Markdown is supported, so you can write inline code like `<div>this</div>` or multiline blocks of code in in triple backtick fences like this:

  function example() {
    element.innerHTML = "<div>code</div>";

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed