ext/xml case folding broken for non-ASCII characters
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
See ext/xml/tests/xml007.phpt
The code will never run in 8.2 or up because of changes to how strtoupper works. This means the test will be skipped due to the SKIPIF settings which has a locale-dependent strtoupper check.
Removing the SKIPIF shows that the test is indeed broken, even on systems where it worked on 8.1 it won't work on 8.2.
Other than that, this never worked properly because it depends on the locale.
From https://www.w3.org/TR/WD-xml-970807.xml
case-folding: a process applied to a sequence of characters, in which those identified as non-uppercase (in scripts which have case distinctions) are replaced by their uppercase equivalents, as specified in The Unicode Standard, Version 2.0, section 4.1. Note that Unicode recommends folding to lowercase; for compatibility reasons, XML processors must fold to uppercase. Case-folding, as described here, neither requires nor forbids the normalization of Unicode character sequences into canonical form (e.g. as described in The Unicode Standard, section 5.9).
So it's not supposed to depend on the locale.
PHP Version
8.1 / 8.2 depending on your point of view
Operating System
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit ext/xml/tests/xml007.phpt, einschließlich seines locale-abhängigen SKIPIF, und reproduziere den Fehler unter PHP 8.2 oder neuer. Verfolge das ext/xml-Verhalten bei der Groß-/Kleinschreibung im Zusammenhang mit strtoupper und überprüfe, dass der Test ausgeführt wird und eine locale-unabhängige Großschreibungsbehandlung für Nicht-ASCII-Zeichen liefert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- internationalization
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100