Expose a function to check whether a string is valid UTF-8
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
Checking whether a string is valid UTF-8 is a common need, as many projects require UTF-8 encoding (to be able to use the u modifier in regex for instance, among other use cases).
As zend_string already has internal optimizations to remember that a string is valid UTF-8, implementing such function in core would provide several benefits over a userland implementation (it can both read the flag for a fast-path answer and set the flag at the end of the slow path to remember the validity for next usages of the string).
This could be implemented as a function is_valid_utf8(string $string): bool function
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 damit, zend_string und die vorhandene Logik zur Verfolgung oder Validierung der UTF-8-Gültigkeit im PHP core zu lokalisieren. Die Arbeit ist abgeschlossen, wenn eine Funktion is_valid_utf8(string $string): bool verfügbar ist und die gemerkte Gültigkeit verwenden kann, während sie diese für nachfolgende Aufrufe feststellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100