1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 05:32:28 +02:00
Files
archived-php-src/ext
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
..
2020-10-07 14:58:43 +02:00
2020-10-26 11:06:10 +01:00
2020-10-22 14:50:52 +02:00
2020-10-26 13:15:03 +01:00
2020-10-02 11:56:16 +02:00
2020-10-09 17:02:20 +02:00
2020-10-23 16:56:23 +02:00
2020-10-22 15:07:01 +02:00
2020-10-15 10:17:55 +02:00
2020-10-09 15:25:23 +02:00
2020-10-23 20:48:52 +01:00
2020-10-24 15:36:05 +02:00
2020-09-03 15:07:03 +02:00
2020-10-13 15:34:12 +02:00
2020-10-27 10:31:09 +03:00
2020-10-26 17:01:25 +01:00
2020-10-26 17:01:25 +01:00
2020-10-13 12:32:08 +02:00
2020-10-12 18:09:08 +02:00
2020-10-14 16:58:07 +02:00
2020-10-06 09:49:40 +02:00
2020-10-22 14:56:00 +02:00
2020-09-30 21:07:25 +02:00
2020-09-18 14:28:32 +02:00
2020-09-18 14:28:32 +02:00
2020-10-08 17:10:52 +02:00
2020-10-13 10:41:43 +02:00
2020-10-26 11:06:25 +01:00
2020-10-22 16:05:57 +02:00
2020-10-09 10:43:35 +02:00
2020-10-08 10:28:50 +02:00
2020-10-08 10:28:50 +02:00
2020-10-26 15:15:17 -07:00
2020-10-26 11:40:06 +01:00