Hello Rui, many thanks!!!
Sunday, March 23, 2008, 12:40:59 PM, you wrote: > Hello Marcus, > I try to prepare some short test scripts for zend-multibyte stuff. > It is like, > <?php > declare(encoding='Shift_JIS'); > $s = "表"; // 0x95+0x5c > printf("%x %x\n",ord($s{0}),ord($s{1})); // expected: 95 5c ?>> > The problems to prepare the test scripts are, > 1. php binary should be compiled with --enable-zend-multibyte option. You can provide a --SKIPIF-- section to detect MB support (http://qa.php.net/write-test.php ). --SKIPIF-- <?php if (!in_array("detect_unicode", array_keys(ini_get_all()))) { die "skip Requires --enable-zend-multibyte option"; } ?> > 2. the output of script is depends on mbstring.internal_encoding option. > To obtain the expected output (95 5c in the example), > mbstring.internal_encoding=SJIS should be defined in php.ini or > a runtime option like, > 'php -d mbstring.internal_encoding=SJIS test.phpt' > mbstring.internal_encoding cannot be specified in the script by > ini_set(). There is the --INI-- section in .phpt's (http://qa.php.net/write-test.php ). --INI-- mbstring.internal_encoding=SJIS I have created a new directory Zend/tests/multibyte and added a first test based on your script above. Please provide more of those. I am CC'ing internals@ so that more people see how to write tests for it in the hope of getting more tests. Marcus > On Sat, 22 Mar 2008 15:12:58 +0100 > Marcus Boerger <[EMAIL PROTECTED]> wrote: >> Hello Rui, >> >> what we really need is tests. If we do not get tests we will keep >> multibyte support out of PHP. Maybe you can mail some Asian user groups who >> probably use this feature to provide some .phpt files? >> >> marcus >> >> Tuesday, March 4, 2008, 12:06:58 AM, you wrote: >> >> > Johannes, >> >> > I send a short presentation material (php-i18n-20050227.ppt) >> > which I made it for the meeting with Zeev. >> >> > Please look page 6, there are short descriptiion about the current >> > implementation. >> >> > Some multibyte encodings like ShiftJIS (Japanese) and Big5 (Chinese) >> > are including 0x5c as secodnig byte of some multibyte characters. >> > In the current implementation, pre-scanner and after-scanner encoding >> > conversion is applied (er. Shift-JIS -> UCS-2 -> Shift-JIS) >> > because flex based scanner cannot handle these characters. >> >> > Rui >> >> > On Mon, 03 Mar 2008 20:43:23 +0100 >> > Johannes Schlueter <[EMAIL PROTECTED]> wrote: >> >> >> Rui, >> >> >> >> as you maybe have read in [1] Marcus and a few other guys are currently >> >> working on replacing the flex based parser by one based on re2c. In the >> >> current development version --enable-zend-multibyte is ignored and we >> >> (see internals list) have no clue what exactly it is meant to do and >> >> what won't be possible without that switch. Since you're listed as one >> >> of the authors of zend_multibyte.c and are still working on mbstring I >> >> was wondering if you might have some examples of stuff which won't work >> >> without --enble-zend-multibyte, best would be .phpt tests, so we can >> >> make sure we don't break anything if we go and replace the scanner. >> >> >> >> [1] http://news.php.net/php.internals/35891 >> >> >> >> Thanks, >> >> johannes >> >> >> >> -- Best regards, Marcus mailto:[EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php