[2.0 B4] Postgresql : modifying boards and adding sections

Started by florent28, September 19, 2008, 11:18:33 AM

Previous topic - Next topic

florent28

When trying to change the current category name, I get this message :
QuoteERREUR: Séquence d'octets invalide pour le codage « UNICODE » : 0xe96ee9
File: /home/blablabla/www/smf2/Sources/Subs-Categories.php
Line: 137

Which basically means:
ERROR: invalid bits sequence for encoding "UNICODE" : 0xe96ee9
File: /home/blablabla/www/smf2/Sources/Subs-Categories.php
Line: 137

Edit : problem is linked to french characters. The text I was trying to write was "Discussions Générales".




If I try to add a section in the category, I get this error :
QuoteERREUR: la valeur courante (currval) de la séquence « smf_boards_seq » n'est pas encore définie dans cette session
File: /home/blablabla/www/smf2/Sources/Subs-Boards.php
Line: 759

which means :
ERROR : current value (currval) of sequence « smf_boards_seq » is not yet defined in this session

Edit 2 : problem is also linked to encoding, as a title with no special characters is ok.

Oldiesmann

Add this code to Settings.php:

$db_character_set = "'UTF8'";

That should fix the issue.
Michael Eshom
Christian Metal Fans

florent28

#2
It didn't change anything, I still get the same error message.

Edit : actually, the second error message is now changed to :
QuoteERREUR: Séquence d'octets invalide pour le codage « UNICODE » : 0xe96ee9
File: /home/blablabla/www/smf2/Sources/Subs-Boards.php
Line: 647

which is the same (almost) message I get when I try to modify a category.

Oldiesmann

What encoding are the db tables? The only time I've ever tried UTF8 with Postgres is with the "SQL_ASCII" encoding.
Michael Eshom
Christian Metal Fans



Kakao


florent28

Indeed, that works !
I didn't know it was possible to change encoding in the language section.

Thanks Kakao ! :)

Oldiesmann

I will try to look at this when I get home from work tonight. I think we just need to make sure to always set the client encoding for PostgreSQL so its built-in conversion functionality will kick in.
Michael Eshom
Christian Metal Fans

Oldiesmann

Ok. After reading over the PostgreSQL documentation, I'm fairly certain that it's due to not using character set conversions...

Can you do a test for me?

Add this code to Settings.php:
$db_charset="'LATIN1'";

After that, switch back to standard English and see if you still get the error.

If that fixes the issue, I'll look into adding support for that functionality to SMF (although I may need to talk to the devs to decide which route is best - likely it would simply be adding the encoding value to the language file).
Michael Eshom
Christian Metal Fans

Kakao

Does not work for me:

ERROR: invalid byte sequence for encoding "UTF8": 0xf36c7665
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
File: /var/www/html/example.com/Sources/Subs-Boards.php
Line: 647

Oldiesmann

Sorry. Wrong varibale name. Change $db_charset to $db_character_set.
Michael Eshom
Christian Metal Fans

Kakao


Oldiesmann

Michael Eshom
Christian Metal Fans

bill_mcgonigle

This still seems to be a problem on RC1.  I tried pasting in some text with fancy-quotes, and got:

ERROR: currval of sequence "smf_messages_seq" is not yet defined in this session
File: /path/to/example.org/forum/Sources/Subs-Post.php
Line: 1819


on a new topic (bummer of an error message...).  If I started the topic and modified it, I got:

ERROR: invalid byte sequence for encoding "UTF8": 0x93

I was able to go in and change the English language character set to 'UTF8' and then it works OK.

That is:  Admin...Configuration...Languages...Edit Languages...English...Character Set:  and fill in UTF8 - no quotes or dashes, for those playing along at home.

Advertisement: