Archives FluxBB.fr

Les archives de FluxBB.fr

Vous n'êtes pas identifié(e).

#1 09-01-2010 16:21:29

Otomatic
Régisseur

Erreurs possibles sur db_update.php lors de la conversion en utf-8

Bonjour,

Soit, par exemple, la table users, colonne location, déclarée en VARCHAR(30), remplie par Savigny - St Rémy de Maurienne (Pile trente caractères).
La transformation en utf-8 va générer : Savigny - St Rémy de Maurienne, ce qui fait 31 caractères, donc trop grand pour le champ et génération d'erreur avec arrêt du processus d'update.


Ce n'est pas parce que l'erreur se propage qu'elle devient vérité. Gandhi
Sont différents : ça et sa - est et ait - à et a - ce et se - mes et mais ou met - été et était - c'est et ces - ce-si et ceci
La vie sans musique est tout simplement une erreur, une fatigue, un exil. Friedrich Nietzsche

Hors ligne

#2 22-01-2010 21:45:58

Mpok
Néo Admin

Re : Erreurs possibles sur db_update.php lors de la conversion en utf-8

Une nouvelle version de db_update.php a été publiée sur le SVN du .org, censée corriger cette erreur.
(Note : et ça pourrait également régler le pbm soulevé dans ton autre topic..)
J'ai pas encore testé.

Hors ligne

#3 23-01-2010 12:31:46

Otomatic
Régisseur

Re : Erreurs possibles sur db_update.php lors de la conversion en utf-8

Bonjour,

J'ai testé, en long, en large et en travers. Il y a beaucoup d'amélioration, mais AMHA, ça n'est pas encore ÇA.
Voici les résultats, en anglais, de manière à pouvoir servir aux développeurs.

Hello

- Windows XP Home SP3
- Apache 2.2.14
- PHP 5.3.1
- MySQL 5.1.42
- PhpMyAdmin 3.2.5
- db_update 1.4-rc1 revision 3
- origin database : FluxBB 1.2.22
--------------------
Export database FluxBB 1.2.22 with PhpMyAdmin
fluxbb_bans structure :

CREATE TABLE `fluxbb_bans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(200) COLLATE latin1_general_ci DEFAULT NULL,
  `ip` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
  `email` varchar(50) COLLATE latin1_general_ci DEFAULT NULL,
  `message` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
  `expire` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ;

Launch db_update without charset conversion because :
IMPORTANT! Based on a random selection of 100 posts, topic subjects, usernames and forum names from the database, it appears as if text in the database is currently UTF-8 encoded. This is a good thing. Based on this, the update process will not attempt to do charset conversion. If you have reason to believe that the charset conversion is required nonetheless, you can force the conversion to run.

The fluxbb_structure after db_update is :

CREATE TABLE `fluxbb_bans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `ip` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `email` varchar(80) DEFAULT NULL,
  `message` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `expire` int(10) unsigned DEFAULT NULL,
  `ban_creator` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

The default charset is utf8, but all text columns are always CHARACTER SET latin1 and it is the same for all text columns of all tables.

If I launch db_update forcing data conversion :
- Perform charset database conversion
- Current character-set : ISO-8859-1
there is an error
FluxBB reported: Unable to update post
Database reported: Incorrect string value: '\xE2\x9C\x91[/l...' for column 'message' at row 1 (Errno: 1366)

Sorry, but E2 9C 91 is not an incorrect string value ; it is unicode character ✑ or ✑. The name is BEC DE PLUME BLANC.
You can see this character at : http://aviatechno.free.fr/vilgenis/57-6 … _57-60.php in the table of names, at the left of each name.

-----------
From fluxbb 1.2.22 database I launch SQL queries :

ALTER TABLE fluxbb_bans CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_categories CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_censoring CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_config CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_forums CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_forum_perms CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_groups CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_online CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_posts CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_ranks CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_reports CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_search_cache CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_search_matches CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_search_words CONVERT TO CHARSET utf8 COLLATE utf8_bin;
ALTER TABLE fluxbb_smilies CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_subscriptions CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_topics CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE fluxbb_users CONVERT TO CHARSET utf8 COLLATE utf8_unicode_ci;

Then I launch db_update.php without charset conversion and all things from the forum seems to work well.
The fluxbb_structure after db_update is :

CREATE TABLE `fluxbb_bans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(80) DEFAULT NULL,
  `message` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `expire` int(10) unsigned DEFAULT NULL,
  `ban_creator` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

Default charset is utf8 AND all text columns are CHARACTER SET utf8

Best regards,


Ce n'est pas parce que l'erreur se propage qu'elle devient vérité. Gandhi
Sont différents : ça et sa - est et ait - à et a - ce et se - mes et mais ou met - été et était - c'est et ces - ce-si et ceci
La vie sans musique est tout simplement une erreur, une fatigue, un exil. Friedrich Nietzsche

Hors ligne

Pied de page des forums