News:

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

Main Menu

SMFPacks.com Shoutbox

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

Previous topic - Next topic

michalm

Hi,
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
Mike

michalm

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:

hxxp:stackoverflow.com/a/4786568/22302252 [nonactive]

Oldiesmann

$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

Advertisement: