ID:               33273
 Comment by:       nick dot telford at ntlworld dot com
 Reported By:      lars dot jensen at careercross dot com
 Status:           Open
 Bug Type:         Arrays related
 Operating System: FreeBSD 5.3
 PHP Version:      5.0.3
 New Comment:

If that source is causing that error it's not because of the kanji
sequences. You've got an extra comma (,) at the end of your array()
statement.

Your code:
$foo = array (
         'One Text' => 'some kanji',
         'Another Text' => 'more kanji',
       );

The last comma, should not be present, as PHP expects another argument
to follow it. Simply remove it:
$foo = array (
         'One Text' => 'some kanji',
         'Another Text' => 'more kanji'
       );

On a related note, if you wish to code using non-western character
sets, full Unicode support is being added into PHP5 (most likely, the
next major release after 5.1 will have it). This should be of great use
to you when it's released.

Nicholas Telford


Previous Comments:
------------------------------------------------------------------------

[2005-06-08 10:47:09] lars dot jensen at careercross dot com

Description:
------------
Certain Kanji direct in source seems to be a problem - wanted to use a
small array for some simple language changes between english /
japanese, but with these given kanji's it fail.

Viewing the Kanji's as ascii, they both hold " in it, but closing the
array strings using ', it shouldnt affect the strings.

Example provided at http://www.ebenkyo.com/bug.php

/ Lars

Reproduce code:
---------------
As the code holds kanji characters, use this page to see the source.
Please ensure to see the page using shift_jis encoding

http://www.ebenkyo.com/bug_source.php

Expected result:
----------------
The array not to fail with given Kanji's. Most Kanji sequences seem to
work.

Actual result:
--------------
Parse error: parse error, unexpected T_STRING, expecting ')' in
/usr/local/www/www.ebenkyo.com/bug.php on line 4

or similar


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33273&edit=1

Reply via email to