0

I have some really strange problem. I have a MySQL database and a sample php page (I'm working with CakePHP if this information can help to solve the problem). When I select from the database and print the information on the screen I get something like - "??????". The fields in the database are with collation "utf8_general_ci" like the whole tables and the whole database. The php/html document have "" and there are still "??????" what can I do to solve my problem and view the text in the language I want?

4
  • how about showing us the code you are using to save this to the db... Commented Oct 14, 2012 at 21:04
  • Are you viewing the page with the correct encoding in your browser? Commented Oct 14, 2012 at 21:05
  • "On the screen"? In the browser? In a terminal window? Somewhere else? Commented Oct 14, 2012 at 21:09
  • I've inserted the entries through the phpmyadmin "Insert" option. I also tried with SQL code like this -> INSERT INTO cities VALUES('','София') and the result was the same. I can see this in php my admin but I can't in the browser Commented Oct 14, 2012 at 21:22

1 Answer 1

3

Are you still adding a HTML charset?

<?php echo $html->charset('utf-8'); ?>

In a config.php make sure that is properly encoding. In a config/database.php:

'encoding' => 'utf8'

Or you are using standard latin encoding such as ISO-8859-1:

'encoding' => 'ISO-8859-1'
Sign up to request clarification or add additional context in comments.

1 Comment

I forgot about the "encoding" property in the cakePHP's database config file. Thanks! : )

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.