|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
thiebo Smarty Pro
Joined: 16 Jan 2005 Posts: 144 Location: Paris
|
Posted: Mon Oct 24, 2005 5:59 pm Post subject: transformer un string en utf8 |
|
|
Rien de bien extraordinaire, mais j'ai vu que les arrays retournés par mysql pouvaient être parfois en latin1 alors que tout (tables, les scripts .php etc.) sont en utf8. Voici un petit plugin :
http://www.phpinsider.com/smarty-forum/viewtopic.php?p=25287#25287 |
|
Back to top |
|
Abalam Smarty Rookie
Joined: 14 Jul 2003 Posts: 12
|
Posted: Sat Jan 21, 2006 11:46 pm Post subject: |
|
|
Oui je connais bien ce problème mais je ne pense pas que mettre un |utf8 sur toutes les variables à afficher soit une solution...
Je pense plutôt que la solution se trouve dans la bonne configuration de otn serveur MySQL ou de la base en question ! |
|
Back to top |
|
thiebo Smarty Pro
Joined: 16 Jan 2005 Posts: 144 Location: Paris
|
Posted: Sun Jan 22, 2006 5:57 am Post subject: |
|
|
oui et non...
C'est vrai que mettre |utf8 n'était pas une bonne solution, mais la configuration du serveur mysql ne suffit pas.
Tu peut être sous mysql 4.1 ou 5 et mettre l'interconnection et l'encodage des tables en utf8, pour que ta connection avec php se passe sans souci, il te faudra faire :
mysql_query("SET NAMES 'UTF8'");
Merci pour ta réponse en tous cas. |
|
Back to top |
|
Abalam Smarty Rookie
Joined: 14 Jul 2003 Posts: 12
|
Posted: Sun Jan 22, 2006 10:39 pm Post subject: |
|
|
Je te suggère en plus d'utiliser un objet mysqli pour ta connection, c'est bcp + pratique ! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|