printing foreign text for PHP on UBUNTU and CENTOS

Posted by hao on Server Fault See other posts from Server Fault or by hao
Published on 2010-05-28T15:03:05Z Indexed on 2010/05/28 15:12 UTC
Read the original article Hit count: 447

Filed under:
|
|

Hey guys,

I am using domdocuments and using things like $div->nodeValue to obtain certain info from a web page.

On my ubuntu machine when i do php crawl.php everything is displayed properly in Chinese (the page is in UTF-8).

However on my CENTOS machine using the same code I get æ´å¤åå¸ when I print in the terminal. and when I save it to the database, the characters are also messed up.

One thing I noticed is that when I do print $content, both systems display them properly.

© Server Fault or respective owner

Related posts about ubuntu

Related posts about php