php-src/ext/mbstring
Alex Dowad d9ddeb6e85 UTF-16 text conversion handles truncated characters as illegal
This broke one old test (Zend/tests/multibyte_encoding_003.phpt), which used
a PHP script encoded as UTF-16. The problem was that to terminate the test
script, we need the text: "\n--EXPECT--". Out of that text, the terminating
newline (0x0A byte) becomes part of the resulting test script; but a bare
0x0A byte with no 0x00 is not valid UTF-16.

Since we now treat truncated UTF-16 characters as erroneous, an extra '?' is
appended to the output as an 'illegal character' marker.

Really, if we are running PHP scripts which are treated as encoded in UTF-16
or some other arbitrary text encoding (not ASCII), and the script is not
actually a valid string in that encoding, inserting '?' characters into the
code which the PHP interpreter runs is a bad thing to do. In such cases, the
script shouldn't be treated as UTF-16 (or whatever) at all.

I wonder if mbstring's encoding detection is being used in 'non-strict' mode?
2020-10-27 10:19:00 +02:00
..
libmbfl UTF-16 text conversion handles truncated characters as illegal 2020-10-27 10:19:00 +02:00
tests Add test suite for ISO-8859-x encoding verification and conversion 2020-10-16 22:25:48 +02:00
ucgendat [ci skip] Move OpenLDAP license to redistributable info file 2019-05-06 23:02:46 +02:00
config.m4 Remove redundant includes from mbstring (and make sure correct config.h is used) 2020-08-31 23:17:58 +02:00
config.w32 Remove redundant includes from mbstring (and make sure correct config.h is used) 2020-08-31 23:17:58 +02:00
CREDITS
mb_gpc.c Don't guard mbstring code with #ifdef HAVE_MBSTRING 2020-08-31 23:18:13 +02:00
mb_gpc.h Don't guard mbstring code with #ifdef HAVE_MBSTRING 2020-08-31 23:18:13 +02:00
mbstring.c Remove unused IS_SJIS1 and IS_SJIS2 macros 2020-10-14 08:31:51 +02:00
mbstring.h Don't guard mbstring code with #ifdef HAVE_MBSTRING 2020-08-31 23:18:13 +02:00
mbstring.stub.php Normalize mb_ereg() return value 2020-10-13 20:40:55 +02:00
mbstring_arginfo.h Normalize mb_ereg() return value 2020-10-13 20:40:55 +02:00
php_mbregex.c Normalize mb_ereg() return value 2020-10-13 20:40:55 +02:00
php_mbregex.h Fix [-Wundef] warning in MBString extension 2020-05-16 15:31:20 +02:00
php_onig_compat.h
php_unicode.c Don't guard mbstring code with #ifdef HAVE_MBSTRING 2020-08-31 23:18:13 +02:00
php_unicode.h Don't guard mbstring code with #ifdef HAVE_MBSTRING 2020-08-31 23:18:13 +02:00
unicode_data.h Update Unicode tables to 13.0.0 2020-03-12 11:29:51 +01:00