0

I have a table, in joomla I'm getting the following data: enter image description here

1. fc k��ln - vfl wolfsburg
germany 1. bundesliga 

so I created a test page, I set up the header as utf-8, and everything was fine, I received the wanted data:

Array
(
    [0] => Array
        (
            [id] => 4e36e64eb34d2
            [team1] => 1. FC Köln
            [team2] => VFL Wolfsburg
            [league] => Germany 1. Bundesliga
            [sport] => Soccer
            [time] => 2011-08-06 15:30:00
        )

)

I also check the joomla header and it's contains the charset:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

What am I doing wrong?

2 Answers 2

1

your database connection has to be set UTF8

set the mysql connection charset in includes/database.php file at about line 102 (second line below)

$this->_table_prefix = $table_prefix; 
//@mysql_query("SET NAMES 'utf8'", $this->_resource); // THIS IS THE LINE TO UNCOMMENT 
$this->_ticker = 0; 
$this->_og = array();

Ofcourse your data in table has to be utf-8, check this.

Other possibible thing to check is if your browser sees this page as utf8 (in firefox: View->character encoding)

Sign up to request clarification or add additional context in comments.

2 Comments

This is hepl a little bit, before I had two question marks, now I have only one:)
I have figured out the problem, before the upload I'm executing this ( "SET NAMES 'utf8'");
1

Maybe your files are in wrong encoding? I was having similar problem whan my files were in CP-1251, all data were in UTF-8 and I needed to show danish symbols. Changing file-encoding has solved this problem. Try, maybe it will be helpfull for you too.

2 Comments

Yes, I know this problem, but beside the mysql data, I also printing out other data which are good.
Are you using any string php functions(strpos, str_replace, strcmp, sustr, etc)? As far as I know they don't work with ust8-strings. Try to use mb_-prefixed function for string manipulations(functions from php extention called mb_string).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.