Portal Home > Knowledgebase > Articles Database > PHP cannot read Chinese Text Files


PHP cannot read Chinese Text Files




Posted by Gigaron, 11-17-2008, 09:59 PM
PHP cannot read Chinese Text Files Does PHP need to be compiled with enable-multibyte to be able to read Chinese Text Files? It keeps saying there is a syntax error on line 24 of my file but it looks fine to me.

Posted by jaseeey, 11-18-2008, 12:04 AM
What is the code on line 24?

Posted by Gigaron, 11-18-2008, 12:06 AM
something like $lang['444'] = "chinese text here"; it looks the exact same as the other lines. I even tried deleting the first 30 lines and it still says line 24 error.

Posted by Codebird, 11-18-2008, 05:15 AM
it would be more helpful if you show your whole code so that somebody can help you... __________________Hicham MallahWeb Developer

Posted by Gigaron, 11-18-2008, 05:29 AM
Something like below, but this is English. I cannot write Chinese on this forum as it won't show characters here. There is nothing wrong with the format or syntax. The only thing that is different is there is chinese characters inside the " ".

Posted by bager, 11-18-2008, 02:44 PM
put single quotes around the chinese text: $lang['444'] = 'chinese text here'; for manipulation of such strings check:http://www.php.net/mbstring

Posted by Barti1987, 11-18-2008, 04:48 PM
Nope, you can use any language. Just insure the text is escaped if it has the enclosing tag. Peace, __________________NEW: What Is Their IP - Anyone's IP a click away. URL Tracker, Shortener, Blocker, Unblocker, Whois and More.

Posted by Gigaron, 11-19-2008, 03:14 AM
Solved the problem. The file needs to be saved as UTF-8 while using NotePad. Notepad defaults in ANSI. Thanks.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
MySQL restore a DB (Views: 700)
strange mysql crash (Views: 705)
shoutcast error (Views: 637)