Search

Rss Posts

Rss Comments

Login

 

phpdug symbols encoding problem

Jul 25

phpdug coul not works normal with russian and other languages well in front and backed

to fix this you need just add

1
2
3
4
5
mysql_query( "set session character_set_server=utf8;", $db_connection );
mysql_query( "set session character_set_database=utf8;", $db_connection );
mysql_query( "set session character_set_connection=utf8;", $db_connection );
mysql_query( "set session character_set_results=utf8;", $db_connection );
mysql_query( "set session character_set_client=utf8;", $db_connection );

to

line 81

1
2
3
4
5
6
7
8
9
10
11
function db_connect($config)
{
$db_connection = @mysql_connect ($config['db']['host'], $config['db']['user'], $config['db']['pass']) OR error (mysql_error(),$config, __LINE__, __FILE__, 0, '');
$db_select = @mysql_select_db ($config['db']['name']) or error (mysql_error(),$config, __LINE__, __FILE__, 0, '');
mysql_query( "set session character_set_server=utf8;", $db_connection );
mysql_query( "set session character_set_database=utf8;", $db_connection );
mysql_query( "set session character_set_connection=utf8;", $db_connection );
mysql_query( "set session character_set_results=utf8;", $db_connection );
mysql_query( "set session character_set_client=utf8;", $db_connection );
return $db_connection;
}

public_html\includes\functions\func.global.php

5 Comments

Add your comment

  1. Alex
    May 02 at 17:44

    Hi, it’s very intresting the solution you provide. However in my case spanish accents are not working when creating content (new page) in admin.
    Then, by applying the changes you mention, accents are shown correctly. But they will fail again when re-editing the same page in admin.

  2. migovilo
    Sep 05 at 04:49

    Hey alex, change charset to utf8 in admin *.php pages:

    must be:

  3. Alex
    Sep 23 at 23:41

    Hello,
    Thank you!

  4. J-Hong
    Nov 11 at 12:54

    migovilo, Thank you so much.

  5. Anna
    Jan 13 at 11:56

    Comments on my phpdug website are not working, when you click the comment link nothing is happening, you can not add comments or view comments, it looks like there are not any comments pages, any idea how to fix it? or where is the problem?

Post a comment

 
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
31 queries. 0.515 seconds.