Page MenuHomePhabricator

InvalidArgumentException: Asked for code outside of range (55296)
Open, Needs TriagePublic

Description

Seen on https://gerrit.wikimedia.org/r/c/utfnormal/+/770668

https://integration.wikimedia.org/ci/job/composer-package-php80-docker/7397/console

02:38:20 1) Warning
02:38:20 The data provider specified for UtfNormalTest::testInvariant is invalid.
02:38:20 InvalidArgumentException: Asked for code outside of range (55296)
02:38:20 /src/src/Utils.php:47
02:38:20 /src/tests/UtfNormalTest.php:131

Details

Event Timeline

Reedy renamed this task from PHPUnit warning on PHP 8 to InvalidArgumentException: Asked for code outside of range (55296).Sat, Aug 6, 1:23 AM

It's actually there on PHP 7.2 - https://integration.wikimedia.org/ci/job/composer-package-php72-docker/21517/console

20:40:14 > parallel-lint . --exclude vendor -e php,inc
20:40:14 PHP 7.2.34 | 10 parallel jobs
20:40:14 ............                                                 12/12 (100 %)
20:40:14 
20:40:14 
20:40:14 Checked 12 files in 0.1 seconds
20:40:14 No syntax error found
20:40:14 > phpunit
20:40:15 PHPUnit 8.5.28 #StandWithUkraine
20:40:15 
20:40:15 ................................................................. 65 / 97 ( 67%)
20:40:42 ...............................W                                  97 / 97 (100%)
20:40:42 
20:40:42 Time: 27.73 seconds, Memory: 64.27 MB
20:40:42 
20:40:42 There was 1 warning:
20:40:42 
20:40:42 1) Warning
20:40:42 The data provider specified for UtfNormalTest::testInvariant is invalid.
20:40:42 InvalidArgumentException: Asked for code outside of range (55296)
20:40:42 /src/src/Utils.php:47
20:40:42 /src/tests/UtfNormalTest.php:131
20:40:42 phpvfscomposer:///src/vendor/phpunit/phpunit/phpunit:97
20:40:42 
20:40:42 phpvfscomposer:///src/vendor/phpunit/phpunit/phpunit:97

https://www.fileformat.info/info/unicode/char/55296/index.htm

Do we need to just change the test data? Or handling of the exceptions?

It's not easy to work out which line in UnicodeData.txt this is...

It's not easy to work out which line in UnicodeData.txt this is...

D800;<Non Private Use High Surrogate, First>;Cs;0;L;;;;;N;;;;;

6 rows actually

D800;<Non Private Use High Surrogate, First>;Cs;0;L;;;;;N;;;;;
DB7F;<Non Private Use High Surrogate, Last>;Cs;0;L;;;;;N;;;;;
DB80;<Private Use High Surrogate, First>;Cs;0;L;;;;;N;;;;;
DBFF;<Private Use High Surrogate, Last>;Cs;0;L;;;;;N;;;;;
DC00;<Low Surrogate, First>;Cs;0;L;;;;;N;;;;;
DFFF;<Low Surrogate, Last>;Cs;0;L;;;;;N;;;;;

Change 820681 had a related patch set uploaded (by Reedy; author: Reedy):

[utfnormal@master] Remove codes out of range

https://gerrit.wikimedia.org/r/820681

Change 820681 abandoned by Reedy:

[utfnormal@master] Remove codes out of range

Reason:

https://gerrit.wikimedia.org/r/820681

Change 820681 restored by Reedy:

[utfnormal@master] Remove codes out of range

https://gerrit.wikimedia.org/r/820681