I am trying to get the Zend Engine to interpret my PHP scripts as UTF-16 BE On setup 5.4, I have the following settings in the PHP.ini file:
zend.script_encoding = UTF-16BE zend.detect-unicode = 0 zend.multibyte = on
This is my script index.php:
The file is a total of 32 bytes, which is saved using UTF-16BE:
EFFF / BOM 00 3C 00F 00 70 00 68 00 70 00 20 // & lt ;? Php 00 65 00 63 00 68 00 6 F 00 20 / echo 00 27 00 31 00 27 // '1' 00 3 B //;
However the script is not working; Output & lt ;? Php echo '1';
. 1
instead of
So I tried to remove the BOM:
00 3c 00FFF070 00 68 00 70 00 20 //
But still output and 1
instead of
Then I tried to encode sequence & mdash; & lt ;? Php
& mdash; In ASCII, the remaining characters are UTF-16 BE encoded:
3C 3F 70 68 70 20 //
The engine is now capable of interpreting PHP scripts, but it still does not work:
WARNING: Unexpected character in the input: ' In C: \ Xampp \ htdocs \ test \ index.php on line 1
WARNING: Unexpected character in the input: 'C in: \ xampp \ htdocs \ test \ index.php on line 1
Parse Error: Syntax Error, C1: \ xampp \ htdocs \ test \ index.php Unexpected 'C' (T_ITRTI) 1
How does it work?
How can we interpret the written script in a particular encoding?
Comments
Post a Comment