Question

I have non-ascii characters with utf-8 encoding (Chinese characters), but they're not printed correctly. I have to add decode('utf8', $str) (in controller or template file) to get the right output. How could I set the template to recognize utf-8 string?

Anyhow, the literal stashed string can make the rigth output, and I don't know why. The content are stored in MySQL with utf-8 collection. I added $DB->do("SET NAMES 'UTF8'"); after database is connected, but no effect.

Was it helpful?

Solution

try DBI option mysql_enable_utf8 set to 1.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top