Bonjour,

En glanant des infos à droite et à gauche, j'ai trouvé qu'on peut convertir une table latin1 en convertissant d'abord en binaire, puis en utf8.

J'ai lancé les lignes SQL ci-dessous dans phpMyAdmin, et le site est devenu totalement opérationnel.

Il y a juste que les champs à l'origine de type text et longtext sont devenus blob et longblob. Mais les espaces privé et public de Spip tournent très bien à première vue...

SET NAMES utf8;

ALTER TABLE www18_articles CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_articles CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_articles CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_auteurs CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_auteurs CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_auteurs CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_breves CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_breves CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_breves CONVERT TO CHARACTER SET utf8;
ALTER TABLE www18_documents CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_documents CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_documents CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_forum CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_forum CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_forum CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_groupes_mots CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_groupes_mots CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_groupes_mots CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_messages CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_messages CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_messages CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_meta CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_meta CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_meta CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_mots CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_mots CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_mots CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_ortho_cache CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_ortho_cache CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_ortho_cache CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_ortho_dico CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_ortho_dico CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_ortho_dico CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_petitions CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_petitions CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_petitions CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_referers CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_referers CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_referers CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_referers_articles CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_referers_articles CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_referers_articles CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_rubriques CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_rubriques CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_rubriques CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_signatures CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_signatures CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_signatures CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_syndic CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_syndic CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_syndic CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_syndic_articles CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_syndic_articles CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_syndic_articles CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_tickets CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_tickets CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_tickets CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_types_documents CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_types_documents CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_types_documents CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_versions CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_versions CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_versions CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_versions_fragments CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_versions_fragments CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_versions_fragments CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_visites CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_visites CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_visites CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_visites_articles CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_visites_articles CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_visites_articles CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_zones CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_zones CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_zones CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE www18_zones_liens CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE www18_zones_liens CONVERT TO CHARACTER SET binary;
ALTER TABLE www18_zones_liens CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

Le 27/04/2020 à 15:31, Stephane Santon a écrit :
Bonjour,

J'ai un site Spip 3.2.7 que j'avais avec peine récupéré d'un 1.9.2, et que je désire passer en 3.3dev.

Pour tests, j'ai exporté par PhpMyAdmin le 3.2, installé à côté un Spip 3.3 neuf, importé la base 3.2, et lancé /écrire.
Il m'a mis à jour les tables. OK.

Mais j'ai encore des pb de caractères accentués !
En allant voir la base d'origine, j'ai encore des tables (dont spip_articles) en latin1_swedish_ci, avec site configuré en utf-8.

Je me rappelle que j'avais galéré avec ça pour passer de 1.9.2 à 3.2, et que j'avais entre autres utilisé le plugin Grenier.

Y a-t-il aujourd'hui une procédure plus simple pour passer toutes mes tables en utf8 ?

Merci




--
Stéphane
17 Charente-Maritime
_______________________________________________
liste: https://listes.rezo.net/mailman/listinfo/spip-dev
doc: https://www.spip.net/
dev: https://core.spip.net/
irc://irc.freenode.net/spip

Répondre à