php - problem with special characters -


i retrieving articles blog webiste mysqldb. articles displayed fine on blog on website characters such ţ,ş,ă etc replaced black square question mark inside . have "utf-8" set on document same on blog.

you need tell mysql connection must made in utf-8. use function mysql_set_charset (you need php 5.2.3). if use php < 5.2.3 try :

mysql_query("set character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $conn); 

also make sure headers tells document in utf-8 (header function and/or html meta tags correctly set).

also make sure php files saved in utf-8 without bom.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -