Charset Confusion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OrganForum
    Senior Member
    • Feb 2013
    • 131
    • 5.7.X

    [Bug / Issue] Charset Confusion

    My forum was migrated from 4.2.5 to 5.4.5 and users are experiencing a problem with extended characters displaying incorrectly or truncating text. Searching here, I find that this is not a new problem, but it's not clear to me whether this is still an issue with the current software or a configuration issue. This was not an issue with 4.2.5.

    As suggested here, I checked the Language Settings. The language is set to English (en) and the charset was set to ISO-8859-1. I changed the charset here to UTF-8 as suggest. This had no effect. The legend in the control panel for this setting reads:
    This is the value of the 'charset' attribute for the HTML content type setting in the 'headinclude' template.
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    Looking at the html source from a page in the browser, this meta tag is not present. The 'headinclude' template is not part of VB5 Default style. I did find this code in the preheader template
    Code:
     <vb:if condition="isset($charset) AND ($charset !== false)">
      <meta http-equiv="content-type" content="text/html; charset={vb:var charset}" />
     </vb:if>
    so I'm assuming that the condition is not being met. Why would that be?

    I'm also confused as to whether this line in the include/config.php file should be active or commented out.
    Code:
    // $config['Mysqli']['charset'] = 'utf8';
    It is currently commented out as it was in the default.

    As for the database, the default charset is UTF-8

    Thanks

    VB 5.7.2
    PHP 7.4
    MySQL 8.0.28
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74132

    #2
    The character set should be set by a Server Response header. This is the appropriate way to do this these days.

    Go into your AdminCP. Then go to Languages & Phrases -> Language Manager. Edit your language change your character set to UTF-8 (it is case-sensitive). Save the page.
    Click image for larger version  Name:	2019-01-07_11-53-09.png Views:	1 Size:	102.1 KB ID:	4405741


    Changing your config.php at this time could break your site even more.
    Last edited by Wayne Luke; Mon 7 Jan '19, 11:07am.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • OrganForum
      OrganForum commented
      Editing a comment
      Yes, I've done that. Server response header still showing IS0-8859-1
      After the save the language setting shows:

      This is the value of the 'charset' attribute for the HTML content type setting in the 'headinclude' template.
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      so the case is correct.

    • OrganForum
      OrganForum commented
      Editing a comment
      Yes that was where and how I made the change. After flushing the server cache, the correct charset is now in the header response. Apparently, a cache flush was required and that's why I wasn't seeing the change in the response even a day after the change.

      Hopefully, this will resolve the issue for our users.

      Thanks for your help.

Related Topics

Collapse

Working...