Firefox PHP

Migrating Phorum to UTF-8 (from ISO-8859-1)

Posted by cactux 
Migrating Phorum to UTF-8 (from ISO-8859-1)
October 31, 2017 04:40PM

I am migrating Phorum to UTF-8 (from ISO-8859-1), but I get some problems (one, actually).

First, I changed this line in french.php to have "UTF-8" instead of "ISO-8859-1"
Language: PHP
$PHORUM[';DATA';][';CHARSET';] = "UTF-8";
Then, testing right away (on my dev environment), I see that messages subject containing special chars are missing (such as é è à).
But if I create a new message, with special chars are displayed fine.

So I ran this script from Maurice:

But it does not change this behavior.

What should I do?

Thanks :)

Cactus : []
Re: Migrating Phorum to UTF-8 (from ISO-8859-1)
October 31, 2017 06:35PM
Are you exporting and importing (dump), or altering the table?

If exporting and importing doesn't work correctly, you can export, open the table in an editor, and search and replace with a character that will show correctly, then import. You can find out what that character is by exporting the new message that displays correctly.
Re: Migrating Phorum to UTF-8 (from ISO-8859-1)
November 01, 2017 05:21PM

I am altering the tables.
But the problem is not there: I get it with new messages too.

So to investigate, I did a fresh install of Phorum, latest version, with french.php as language file.
On my dev server, it works fine, I can post this message: "Voilà l'été 1°C".
On my prod server, I get this garbage instead: "Voilà l'été 1°C".

I checked the files encoding, the database table charset, it is the same on both servers.
I don't what to check next, thanks for your help.

Just for information: it used to work fine on this server, but I think there's been an update. I could not find out which exactly. My own PHP scripts are fine, I can receive and store UTF-8 strings without problem.
I have a similar problem with a fresh install of wordpress too: but instead of being garbled, special chars are just removed.

I am at loss :-(

Cactus : []
Re: Migrating Phorum to UTF-8 (from ISO-8859-1)
November 02, 2017 09:36AM
If you don't have one create a file myphpinfo.php
in it place

Language: PHP
<?php   // Show all information, defaults to INFO_ALL phpinfo();   ?>

This should help finding what versions of software are running. Production and dev server.

I suspect the Production server has a default character set of ISO-8859-1 (in php)


Get a dump of your Phorum table structures and verify charset = utf8 , (mysql)


Possible UTF-8 confusion

Because character set names in MySQL do not contain dashes, the string "utf8" is valid in MySQL to set the character set to UTF-8. The string "utf-8" is not valid, as using "utf-8" will fail to change the character set.
Re: Migrating Phorum to UTF-8 (from ISO-8859-1)
November 02, 2017 03:59PM

I finally found the problem: it was caused by wrong values of mbstring variables, such as mbstring.language, mbstring.http_output, and mbstring.internal_encoding, etc. which were at strange values sch as Japanese, EUC-JP, and so on.

Cactus : []
Sorry, only registered users may post in this forum.

Click here to login