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.
Jaseeey
11-18-2008, 12:04 AM
What is the code on line 24?
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.
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
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 " ".
<?
$lang = array();
$lang['0'] = "Advertisement";
$lang['1'] = "About Us";
$lang['2'] = "Enter information about your video sharing website here.";
$lang['3'] = "My Account";
$lang['4'] = "Account Status";
$lang['5'] = "Active";
$lang['6'] = "Not Active";
$lang['7'] = "E-Mail Status";
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
azizny
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.
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.