Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorverb
    • CommentTimeJul 30th 2006 edited
     permalink

    Hi,

    I’m working on a template at the moment, and I’d like to use UTF-8 as charset.

    I’ve got this inside the head section:
    @<meta http-equiv=“content-type” content=“text/html; charset=utf-8”>@

    And I’ve got this at the top of the document (PHP):
    @header(“content-type: text/html; charset=utf-8”);@

    Now, when I type something like “é” in the HTML code I get a “?” in the browser and the validator says it’s an invalid character. However, if I use ISO-8859-1 as charset, the browser can display the character correctly.

    A while ago I’ve worked with the CMS called Textpattern, and it used UTF-8. When I typed “é” in my template the browser could display it correctly. I’ve taken a look at the PHP files of Textpattern to look for the code which made this work, but I can’t find it, unfortunately…

    Maybe someone here knows what I should do?
    (By the way: I’m using HTML 4.01 Strict, don’t know if this is of any value, concerning solving this problem.)

    • CommentAuthorPettyRider
    • CommentTimeJul 30th 2006 edited
     permalink
    I believe there is a PHP function which converts special characters to XHTML entities, which is what you need. Search php.net for it.

    Or, bookmark this page -- http://allforces.com/2006/03/17/special-charcters/#more-122 -- I guarantee you'll use it often.

    You'll eventually memorize these, as they're pretty self-explanitory. The acute "e" for instance, is: & eacute ; (remove those spaces, though)
    • CommentAuthorverb
    • CommentTimeJul 31st 2006 edited
     permalink

    Yes, I know about the entities, I often use this page to look them up: A List Apart Styleguide. I suppose I could use those, that’s not the problem. But with UTF-8 it shouldn’t be necessary to use entities for characters like “é”, if I’m understanding correctly. In systems like Textpattern, Wordpress etc. they’ve used some sort of server side scripting (I think) to make this work like it should, but I can’t find out how precisely they did it.

    • CommentAuthorGustavs
    • CommentTimeJul 31st 2006
     permalink
    Well, I've had the same problem too, but it I found out that the program I used(TopStyle) did not support UTF-8, so I where not able to write in UTF-8. You should check that too.
    • CommentAuthorverb
    • CommentTimeJul 31st 2006 edited
     permalink

    LOL, you got me there… I selected the wrong encoding type in the editor (how foolish of me) :-D
    Thanks man.

Add your comments
    Username Password
  • Format comments as (Help)