0

I have scraped data from a website. This data is placed in a database. When I print the data:

print $row->description;

It comes out looking like this:

• Shoot great photos in low light with bright lens• 

I was previously able to fix this by adding:

header('Content-Type: text/html; charset=UTF-8');
mb_internal_encoding('UTF-8');

I've now tried adding this to index.php of YII, but the output doesn't change. I've also tried:

$decoded = utf8_decode($row->description);
print $decoded;

But then I get:

�?� Shoot great photos in low light with bright lens�?�

How can I get this to work in YII?

Bogdan Burym
  • 5,482
  • 2
  • 27
  • 46
rockstardev
  • 13,479
  • 39
  • 164
  • 296

1 Answers1

0

Try following these steps

How to set up Unicode

Error with UTF8 characters and htmlspecialchars in yii

Community
  • 1
  • 1
devBinnooh
  • 611
  • 3
  • 12