Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu Shoutbox

Started by Nibogo, October 19, 2008, 11:41:06 AM

Previous topic - Next topic


I just installed Shoutbox and noticed that when I use special characters like: ę ł ą I get this: ł ż ń
SMF 2.1.4.
How to check if Shoutbox is UTF-8?
Thank you


It looks like my friend fixed it. Maybe someone will need information on how to do this...

In the file Shoutbox.php in a method that adds messages - Shoutbox_SendMsg, we commented on the line:

$msg = $smcFunc['htmlspecialchars']($msg, ENT_QUOTES);

Why? htmlspecialchars do not work correctly with utf8 characters and htmlentites explained here: [nonactive]


$smcFunc['htmlspecialchars'] isn't the same as htmlspecialchars and will specifically handle UTF8 if you tell it to. The problem is that parameter isn't specified there, so it defaults to ISO-8859-1.

Try this:
$msg = $smcFunc['htmlspecialchars']($msg, ENT_QUOTES, 'UTF-8');
Michael Eshom
Christian Metal Fans