Link to home
Start Free TrialLog in
Avatar of Zopilote
ZopiloteFlag for United States of America

asked on

phpbb not showing accents

My forum is showing strange characters instead of accents after a migration from mysql4 to mysql5, the answer from support is the following:

"Your phpBB forum has a similar configuration problem. Your pages are defined as iso-8859-1 and the data retrieved from the database is encoded in UTF-8. The content type for the pages should be set to UTF-8.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
that should be;
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">"

I don't know where I should change this? can you tell me which file I should change both in PHPBB2 and PHPBB3 directories as I have 2 forums?

Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Use a code scanner like Textpad or Notepad++ and scan the code base for case-insensitive "Charset=".  You'll be able to find the culprits in a jiffy!
SOLUTION
Avatar of edster9999
edster9999
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hmm. It's not clear to me that UTF-8 is the issue.  I used this code snippet for another question recently. The OOP parts are irrlelvant, but the accented character shows just find in 8859-1.
<?php // RAY_temp_foo.php

echo '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';

Class Thing
{
    public function ShowSummary() {
        return "<p>Seu carrinho de compras está vazio.</p>";
    }
}

$t = new Thing;
echo $t->ShowSummary();

echo "<p>Seu carrinho de compras está vazio.</p>";

Open in new window

Avatar of Zopilote

ASKER

Dear All, sorry I was too busy.

edster9999, thank you I found it.  Unfortunately Ray_paseur is right it doesn't solve the problem at all.

do you have any ideas how to solve this problem?
It's probably a matter of consistency in the "charset" area.  If all of your data base and your web pages use the same ISO-8859-1 encoding you should be OK.

Or are you trying to use Korean language or something like that?
This is an old forum, it used to be in MYSQL4, and worked fine with Spanish.
To use WordPress I requested migration to MYSQL5.
after upgrade the accents were shown as strange characters.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| protocol_version        | 10                           |
| version                 | 5.0.90-log                   |
| version_comment         | Gentoo Linux mysql-5.0.90-r2 |
| version_compile_machine | x86_64                       |
| version_compile_os      | pc-linux-gnu                 |
+-------------------------+------------------------------+
5 rows in set (0.01 sec)

mysql> sHOW VARIABLES LIKE "%CHAR%";
+--------------------------+----------------------------------------+
| Variable_name            | Value                                  |
+--------------------------+----------------------------------------+
| character_set_client     | utf8                                   |
| character_set_connection | utf8                                   |
| character_set_database   | utf8                                   |
| character_set_filesystem | binary                                 |
| character_set_results    | utf8                                   |
| character_set_server     | utf8                                   |
| character_set_system     | utf8                                   |
| character_sets_dir       | /usr/local/mysql/share/mysql/charsets/ |
+--------------------------+----------------------------------------+
8 rows in set (0.00 sec)

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I modified phpBB2/language/lang_english/lang_main.php
//$lang['ENCODING'] = 'iso-8859-1';
$lang['ENCODING'] = 'UTF-8';
and converted again.