Charset problem with PHPMYFAQ

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
leoh
Posts: 6
Joined: Wed Mar 22, 2006 1:33 pm

Charset problem with PHPMYFAQ

Post by leoh »

Iam having problems with chars like ççç ááá ééé in PHPMYFAQ.
I don't know if it's a SuseLinux configuration or event MYSQL configuration.
Could anyone help me?

Conteúdo: - “add host” adds a computer to the list of computers that you want PATROL Integration for Tivoli to manage - “update host” modifies the configuration ..
Thorsten
Posts: 15564
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Charset problem with PHPMYFAQ

Post by Thorsten »

Hi,

which language do you use?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leoh
Posts: 6
Joined: Wed Mar 22, 2006 1:33 pm

Re: Charset problem with PHPMYFAQ

Post by leoh »

I use portuguese from Brasil.
Thorsten
Posts: 15564
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Charset problem with PHPMYFAQ

Post by Thorsten »

Hi,

can you show me your FAQ?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leoh
Posts: 6
Joined: Wed Mar 22, 2006 1:33 pm

Re: Charset problem with PHPMYFAQ

Post by leoh »

Sure!
See attached image, please.
You do not have the required permissions to view the files attached to this post.
Thorsten
Posts: 15564
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Charset problem with PHPMYFAQ

Post by Thorsten »

Hi,

I think I know the problem. It looks like you use UTF-8 as charset in the database, but the language file for Brazilian Portuguese is ISO-8859-1. This cripples some characters...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
johanna
Posts: 23
Joined: Mon Jun 08, 2009 1:09 pm
Location: Finland

Re: Charset problem with PHPMYFAQ

Post by johanna »

Hi, it's me again... Sorry to bother you this much!

I don't know if Leoh could fix the problem but I'm having the same issue. I'm using Finnish in my site and the database charset is latin1. Still a and o with dots above (ä and ö, are they shown here..?) are saved to database as question marks. Now, the site is not in my localhost but on my company's server. Any ideas where I should start from?
Thorsten
Posts: 15564
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Charset problem with PHPMYFAQ

Post by Thorsten »

Hi Johanna,

no problem.

You shouldn't get any of the charset problems... as finnish characters are almost the same like in German I tested that and everything works here on my test installations. Do you have special configurations for PHP/MySQL?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
johanna
Posts: 23
Joined: Mon Jun 08, 2009 1:09 pm
Location: Finland

Re: Charset problem with PHPMYFAQ

Post by johanna »

I asked about special configurations and they said the database may force data to be utf-8. So I have to find a solution for this. Thanks for showing me the way!
Thorsten
Posts: 15564
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Charset problem with PHPMYFAQ

Post by Thorsten »

Hi,
johanna wrote:I asked about special configurations and they said the database may force data to be utf-8.
this is the problem.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
johanna
Posts: 23
Joined: Mon Jun 08, 2009 1:09 pm
Location: Finland

Re: Charset problem with PHPMYFAQ

Post by johanna »

Yes, you were right!

I solved the problem in /inc/Init.php:

Find:

Code: Select all

$db = PMF_Db::db_select($DB['type']);
$db->connect($DB['server'], $DB['user'], $DB['password'], $DB['db']);
Replace:

Code: Select all

$db = PMF_Db::db_select($DB['type']);
$db->connect($DB['server'], $DB['user'], $DB['password'], $DB['db']);
$db->query("SET NAMES 'latin1';");
The last line is added.
Thorsten
Posts: 15564
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Charset problem with PHPMYFAQ

Post by Thorsten »

Hi,

yes, this is the solution. :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leoh
Posts: 6
Joined: Wed Mar 22, 2006 1:33 pm

Re: Charset problem with PHPMYFAQ

Post by leoh »

Great! Solved.
Post Reply