1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting characters from forum to display correctly

Discussion in 'XenForo Development Discussions' started by Member 3639, Dec 6, 2010.

  1. Member 3639

    Member 3639 Active Member

    Hi everyone stupid question time again:

    If you look here -> http://www.gamingonlinux.info/ on the latest news you will see some characters don't show up correctly, i get my news from the xenforo forum i have and it's using xenforo's parser too, so i am wandering how i can get my page to show up characters properly?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You need to use UTF8 encoding for your home page/portal.
  3. Member 3639

    Member 3639 Active Member

    I do already
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    Seems to do nothing though, do i need to do anything else?
  4. Indigo

    Indigo Active Member

    Somehow you need to write your content using UTF-8. I overrode the encoding in my browser to ISO-8859-1 and there were no broken characters, but XenForo is built on UTF-8, so you would need to try getting your content into it as UTF-8.

    Edit: This looks to be a customized application, so you would either need to change the encoding in the header, or convert your database and code to use UTF-8.
  5. Member 3639

    Member 3639 Active Member

    It's all using Xenforos database and renderer.

    As you can see from the meta tag i posted, my content is set to utf-8.
  6. Indigo

    Indigo Active Member

    Yes, that tells the browser to expect and render the site in UTF-8. However, some of the characters on that page are encoded with another character set (the fancy apostrophes and quotes), and errors occur when you try to intermix different sets.
  7. Member 3639

    Member 3639 Active Member

    Those fancy characters come from a post in xenforo which xenforo outputs properly though.
  8. ragtek

    ragtek Guest

    I had a similar problem some time ago.
    I had to encode the whole output.
    [SIZE=15px]function file_get_contents_utf8($fn) {[/SIZE]
    SIZE=10px][FONT=Arial]     $content file_get_contents($fn);       return mb_convert_encoding($content'UTF-8',           mb_detect_encoding($content'UTF-8, ISO-8859-1'true));[/FONT][/SIZE]
    maybe this helps
  9. Member 3639

    Member 3639 Active Member

    Seems the formatted is a best messed up there mate.
  10. Member 3639

    Member 3639 Active Member

    Tried it, that didn't work at all, gave unexpected errors.

Share This Page