News:

Wondering if this will always be free?  See why free is better.

Main Menu

SOLUTION: SMF 1.1.RC2 "UTF-8" Workaround

Started by SpooK, February 11, 2006, 06:32:27 AM

Previous topic - Next topic

SpooK

First, thanks for the great software.

Now to the reason for this post. There has been issues with SMF and UTF-8 "setting it as default". I have viewed a few topics here and decided to go at it on my own. I have found a solution that makes my particular forum (http://win.asmcommunity.net/board/) work as it did in RC1.


  • Open the file named "Sources/Subs.php"
  • Locate "function setupThemeContext()", responsible for setting... well... the theme context :P (can be found on line 2999 of original SMF 1.1.RC2 source)
  • Add the line "$context['character_set'] = 'UTF-8';" to the function, preferably near the end of course (line 3158)... like so...

...
        if (empty($settings['theme_version']))
                $context['html_headers'] .= '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var smf_scripturl = "' . $scripturl . '";
        // ]]></script>';

        if (!isset($context['page_title']))
                $context['page_title'] = '';

$context['character_set'] = 'UTF-8';}

  • Save the file, and enjoy your forums again :)

I am sure a more elaborate solution involving "$context['character_set']" to be set based on settings specified in the database (and linked to language options in the admin center).

Thanks again for the great software, willing to help anytime I can :)

spiros

Does not appear to stop the corruption of the Greek capital Π character...

BadCluster


spiros

Can I test it? The link you gave me does not work somehow...

BadCluster


spiros


mcgrelio

It doesn't work for the latin character à (accented a in italian language).

Advertisement: