#45248 [Opn->Fbk]: Shfift_JIS encoded characters in PHP script cause an error.

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               45248
 Updated by:       [email protected]
 Reported By:      [email protected]
-Status:           Open
+Status:           Feedback
 Bug Type:         Unicode Engine related
 Operating System: Windows Vista
 PHP Version:      6CVS-2008-06-12 (CVS)
 New Comment:

See also bug #45087 (submitted twice..? :)


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

[2008-06-12 15:21:52] [email protected]

Description:
------------
Shift_JIS encoded characters in PHP script 
cause an error. 

A tiny script causes the problem.
It is based on php6/tests/unicode/enc-SJIS.phpt.
For UTF-8 or EUC-JP encoded script, it works fine.




Reproduce code:
---------------
enc-SJIS.php 
<?php
ini_set("unicode.script_encoding", "SJIS");
include("enc-SJIS.inc");
?>

enc-SJIS.inc
<?php
function &#1090;&#1077;&#1089;&#1090;() {
  echo "&#1090;&#1077;&#1089;&#1090; - ok\n";
}

&#1090;&#1077;&#1089;&#1090;();
?>


Expected result:
----------------
&#1090;&#1077;&#1089;&#1090; - ok

Actual result:
--------------
Warning: Illegal or truncated character in input: offset 0, state=0 in
C:\php6\enc-SJIS.inc on line 2

Parse error: syntax error, unexpected $end, expecting T_STRING in
C:\php6\enc-SJIS.inc on line 2



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


-- 
Edit this bug report at http://bugs.php.net/?id=45248&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.