Files
PhpSpreadsheet/tests/data/Calculation/TextData/CHAR.php
T
oleibman b243f2f4e5 CODE/UNICODE and CHAR/UNICHAR
PhpSpreadsheet treats CODE and UNICODE as equivalent, likewise for CHAR and UNICHAR. They are, in fact, different. CODE and CHAR deal only with single-byte character sets (Windows-1252 or MacRoman), while UNICODE and UNICHAR deal with all of Unicode. This PR separates them. The existing unit test for CODE was, in many cases, applicable to UNICODE (for which there was no separate test). The tests are corrected for CODE, new tests are added, and a separate test for UNICODE is added. CHAR was mostly okay, new tests are added, and a separate test for UNICHAR is added.
2025-11-28 13:21:27 -08:00

97 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
return [
[
'#VALUE!',
'ABC',
],
[
'#VALUE!',
-5,
],
[
'#VALUE!',
0,
],
[
'A',
65,
],
[
'{',
123,
],
[
'~',
126,
],
[
['Á', 'Á', '¡'],
193,
],
[
['ÿ', 'ÿ', 'ˇ'],
255,
],
[
['#VALUE!', 'Ā'],
256,
],
[
['#VALUE!', '⽇'],
12103,
],
[
['#VALUE!', 'œ'],
0x153,
],
[
['#VALUE!', 'ƒ'],
0x192,
],
[
['#VALUE!', '℅'],
0x2105,
],
[
['#VALUE!', '∑'],
0x2211,
],
[
['#VALUE!', '†'],
0x2020,
],
'example 1 different location all 3' => [
['†', mb_chr(134, 'UTF-8'), 'Ü'],
134,
],
'example 2 different location all 3' => [
['€', mb_chr(128, 'UTF-8'), 'Ä'],
128,
],
'non-ascii same win-1252 vs unicode, different mac' => [
['Ð', 'Ð', ''],
0xD0,
],
'last assigned Unicode character' => [
['#VALUE!', mb_chr(0x10FFFD, 'UTF-8')],
0x10FFFD,
],
'highest possible code point' => [
['#VALUE!', '#N/A'],
0x10FFFF,
],
'above highest possible code point' => [
'#VALUE!',
0x110000,
],
'omitted argument' => ['exception'],
'non-printable' => ["\x02", 2],
'bool argument' => ["\x01", true],
'null argument' => ['#VALUE!', null],
'ascii 1 is 49' => ['1', 49],
'ascii 0 is 48' => ['0', 48],
];