Problem with characters ë, ç

Hi all, i am having an issue with storing text in a database (mysql) that contains the characters ë and ç from Albanian. I asked in the mysql forum and they said that the error is probably in the PHP side.

To illustrate i have made a txt file (hi.txt) and in it is written “hehz çadër”. I have this script to read the file and write the content to a DB field:

mysql_query("SET NAMES 'utf8' COLLATE 'utf8_unicode_ci'"); 

$text = mysql_real_escape_string(file_get_contents('hi.txt')); 
echo $text . '<br />'; 

mysql_query("INSERT INTO test (field) VALUES ('$text')");

This echoes “hehz çadër” as intended, but in the database is stored only "hehz ".

Here is a link to the mysql forum discussion:

Plz help,