Supporter les caractères spéciaux
Bonjour,
J'ai créé une table (via phpmyadmin) avec un champ 'name' qui contient les noms des gens. Il peut y avoir des caractères accentués, ç, etc.
Le type est varchar(64) et l'interclassement est celui par défaut : latin1_swedish_ci
J'insère une nouvelle personne dans la table, par exemple "François".
Dans phpmyAdmin, je vois l'entrée qui s'affiche "François".
Dans un shell mysql, je fais la requête select name from people et là je vois bien "François".
Si je modifie le nom via phpMyAdmin, je remplace "François" par "François", alors quand j'affiche les noms via le shell mysql, il m'affiche "Fran?ois".
Alors qu'est-ce que je dois mettre comme interclassement pour avoir la bonne écriture dans phpMyAdmin ET dans le résultat de la requête ?
Et est-ce que interclassement = charset, où il y a une autre variable à setter quelque part ?
Merci
PS : Je viens de faire un dump sur ma DB et je vois ça :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `people`
--
DROP TABLE IF EXISTS `people`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `people` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
) ENGINE=InnoDB AUTO_INCREMENT=10047 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */; |