SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    document encoding

    Hi,

    As far as I remember, documents should be UTF-8 encoded.

    Should I send a header to let the browser now? What is the best way to ensure your pages will be interpreted as utf-8?

    Regards,

    -jj.

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I think it's usually along the lines of:-

    PHP Code:
    <?php
    header
    'Content-Type: text/html; charset=utf-8' );
    ?>
    Check out the specs here.

    SilverB.

  3. #3
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isn't there a dirty trick where if you don't set the file holding your code as utf-8 you get messy results?

  4. #4
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Not entirely sure what you mean, but if you code the output in one charset and output in another, yes you get non rendered characters.

    As in 'best way' to ensure ALL pages are supplied as UTF-8, if you're using Apache you can use a .htaccess to force UTF-8 on anything served.

    SilverB.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •