Topic: Charset problem with spanish

Hi!

I have a punbb installed with the spanish lang in my web: www.suburbiosrock.es (you can see there the problem wink)

The BD has the character set to UTF-8, and in all the pages the charset is set to UTF-8, and after every BD connection, do this SQL query: "SET CHARACTER SET 'utf8'", so all of my pages are shown perfectly and all the inserts too... all works perfectly except the forum (evidently, if doesn't, I wouldn't be writing this...).

1º Case (Generic, like is when installs the forum and the language):
- lang/Spanish/common.php => 'lang_encoding' => 'iso-8859-1',

Result:
- Literals (translation of the forum): "Regístrate" / "Administración" ¡PERFECT!
- Posts of the people: "p?gina" | "dise?o" ¡Wrong!

2º Case (Like in a post here says):
- lang/Spanish/common.php => 'lang_encoding' => 'utf-8',
- include/db_layer/common_db.php => $db->query("SET NAMES 'utf8'");

Result:
- Literals (translation of the forum): "Reg?strate" / "Administraci?n" ¡WRONG!
- Post of the people: "página" | "diseño" ¡PERFECT!

And sometimes (when edit the first post? creating new post in the 2º case? don't remember) give me "Error: Unable to insert search index words".

HELP!! I have a big headache with all of this... any idea? I'm lost...

Thanks,
best regards from Spain (so sorry about my english tongue),
Rodrigo

Re: Charset problem with spanish

You have to change the language encoding in the language file to UTF-8 too. When I set my browser to read the site as UTF-8, it works fine.

Re: Charset problem with spanish

elbekko wrote:

You have to change the language encoding in the language file to UTF-8 too. When I set my browser to read the site as UTF-8, it works fine.

In case 1 or 2? What file? That you mean isn't the lang/Spanish/common.php??

Now is set like the first case (iso...).

Re: Charset problem with spanish

For case 2, you also need to change the character set for the tables.
And if any information that was entered prior to setting up case 2 looks wrong, you'll need to re-enter it because of how it was entered originally.

Re: Charset problem with spanish

Smartys wrote:

For case 2, you also need to change the character set for the tables.

For... is set to UTF8 as I said, all the BD: BD, tables, fields...


Smartys wrote:

And if any information that was entered prior to setting up case 2 looks wrong, you'll need to re-enter it because of how it was entered originally.

Of course I did it... lol

Re: Charset problem with spanish

The collation for the tables is set to latin1 by default. You changed it to utf8?

Re: Charset problem with spanish

Smartys wrote:

The collation for the tables is set to latin1 by default. You changed it to utf8?

Yep... all the DB is set to UTF-8

8

Re: Charset problem with spanish

Have a read through this thread and check everything has been set/altered.

http://punbb.org/forums/viewtopic.php?id=16931

Re: Charset problem with spanish

MattF wrote:

Have a read through this thread and check everything has been set/altered.

http://punbb.org/forums/viewtopic.php?id=16931

That is the 2º case...

10

Re: Charset problem with spanish

Corsario wrote:

That is the 2º case...

Honestly can't say, then. Everything that needs altering should have been covered by that, so I personally have no idea where your problem may lie, although according to the W3C validator, something is amiss:

http://validator.w3.org/check?uri=http% … mp;group=0

The actual content of the db has been converted to UTF-8, I presume?

Re: Charset problem with spanish

MattF wrote:
Corsario wrote:

That is the 2º case...

Honestly can't say, then. Everything that needs altering should have been covered by that, so I personally have no idea where your problem may lie, although according to the W3C validator, something is amiss:

http://validator.w3.org/check?uri=http% … mp;group=0

The actual content of the db has been converted to UTF-8, I presume?

mmm... how? I think that yes...

The BD:
http://img264.imageshack.us/img264/5172/utf81do9.jpg

The 'post' table (for example):
http://img150.imageshack.us/img150/9937/utf82sm0.jpg

God... please, help me!! xD

12

Re: Charset problem with spanish

Those appear fine for any content added from now onwards. However, did you install initially using the iso-8859 charset, or utf-8? If it was setup as iso, and any data entered then, it would still be iso encoded, so that original data would need converting. Have you entered a test thread using Spanish characters since the settings have been set to utf-8, to see whether those are being stored correctly?

Re: Charset problem with spanish

MattF wrote:

Those appear fine for any content added from now onwards. However, did you install initially using the iso-8859 charset, or utf-8? If it was setup as iso, and any data entered then, it would still be iso encoded, so that original data would need converting. Have you entered a test thread using Spanish characters since the settings have been set to utf-8, to see whether those are being stored correctly?

Yep, I have tried. Both cases I've put in the first post with the results... sad

14

Re: Charset problem with spanish

Just had another look. You have a mismatch. Your main index page is specifying utf-8 encoding. Your forums index is not, however:

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

Re: Charset problem with spanish

MattF wrote:

Just had another look. You have a mismatch. Your main index page is specifying utf-8 encoding. Your forums index is not, however:

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

As I said in the second message, now is like the 1st case, like generic: iso with the translations ok but the posts...

16

Re: Charset problem with spanish

Corsario wrote:

As I said in the second message, now is like the 1st case, like generic: iso with the translations ok but the posts...

Why? There is absolutely no point whatsoever to you doing that. You run one or the other. Not both. Set *EVERYTHING* as UTF-8 or ISO_8559-1. Then, and only then, start trying to trace problems, (if by that point they even exist). All headers and everything else should be set to UTF-8 in your case.

Re: Charset problem with spanish

MattF wrote:
Corsario wrote:

As I said in the second message, now is like the 1st case, like generic: iso with the translations ok but the posts...

Why? There is absolutely no point whatsoever to you doing that. You run one or the other. Not both. Set *EVERYTHING* as UTF-8 or ISO_8559-1. Then, and only then, start trying to trace problems, (if by that point they even exist). All headers and everything else should be set to UTF-8 in your case.

Ok, I'm going to set all to UTF-8, but I set that because in that way, the translations of the forum works great... and the forum doesn't seens so bad...

18

Re: Charset problem with spanish

Corsario wrote:

Ok, I'm going to set all to UTF-8, but I set that because in that way, the translations of the forum works great... and the forum doesn't seens so bad...

Good. smile Once you have everything set as UTF-8, then we can try and help on any specific problems. The way you have it set at the moment though is probably creating as many problems. The system/clients will be schizophrenic. big_smile

Re: Charset problem with spanish

Now is set everything to UTF-8, and when I try to post a new threat (Title: "Página", Message: "España Jamón")...

...I can't: "Error: Unable to insert search index words."

...and all the translations of the forum seems wrong

sad

20

Re: Charset problem with spanish

Can you check all the tables in your db admin interface and make sure the encoding is correct, (utf8_general_ci) on all of them?

Re: Charset problem with spanish

And can you enable debug mode?

22 (edited by Corsario 2007-12-05 11:59)

Re: Charset problem with spanish

MattF wrote:

Can you check all the tables in your db admin interface and make sure the encoding is correct, (utf8_general_ci) on all of them?

In addition of the images shown before... one more with some tables (example):

http://img80.imageshack.us/img80/9051/utf83ky4.jpg

elbekko wrote:

And can you enable debug mode?

Ok, Done!

Re: Charset problem with spanish

Oh, right, the language pack.
The language pack is saved in iso-8859-1, so you need to encode it using iconv or a similar tool.

Re: Charset problem with spanish

Smartys wrote:

Oh, right, the language pack.
The language pack is saved in iso-8859-1, so you need to encode it using iconv or a similar tool.

Yep, no problem... the problem is now I can't post due "Unable to insert search index words."... sad

25 (edited by elbekko 2007-12-05 12:01)

Re: Charset problem with spanish

Now that you enabled debug mode, please post the full error.