MyBB Community Forums

Full Version: UTF-8 error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there!

I'm using a localized version of myBB and noticed that all the language strings being read from *.lang.php aren't converted to UTF-8.
This leads to errors when validating the page.

In the following JavaScript-snippet, the character 'ö' will not be converted to UTF-8 and therefore will show up as a non-readable character:
var quickdelete_confirm = "Soll dieser Beitrag wirklich gelöscht werden?";

My workaround for /inc/class_language.php (line 150, v1.2.3):
if(!$this->$key || $this->$key != $val)
{
	$val = preg_replace("#\{([0-9]+)\}#", "%$1\$s", $val);
	$this->$key = utf8_encode($val); //fix
}

Please correct me if I'm wrong.
Or maybe you can save the *.lang.php files using the UTF-8 encoding (your editor will have the option, and should do the conversion on it's own).
Asad Niazi is correct actually. You should save the files in UTF-8. Or they should have been already.
Ok, I just updated the language files with a newer version. That fixed it.

Thanks Wink