Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

transformer un string en utf8

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
thiebo
Smarty Pro


Joined: 16 Jan 2005
Posts: 144
Location: Paris

PostPosted: Mon Oct 24, 2005 5:59 pm    Post subject: transformer un string en utf8 Reply with quote

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
View user's profile Send private message Visit poster's website
Abalam
Smarty Rookie


Joined: 14 Jul 2003
Posts: 12

PostPosted: Sat Jan 21, 2006 11:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
thiebo
Smarty Pro


Joined: 16 Jan 2005
Posts: 144
Location: Paris

PostPosted: Sun Jan 22, 2006 5:57 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Abalam
Smarty Rookie


Joined: 14 Jul 2003
Posts: 12

PostPosted: Sun Jan 22, 2006 10:39 pm    Post subject: Reply with quote

Je te suggère en plus d'utiliser un objet mysqli pour ta connection, c'est bcp + pratique !
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP