Expose a function to check whether a string is valid UTF-8
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.1k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando zend_string e la logica esistente di tracciamento o validazione della validità UTF-8 nel PHP core. Il lavoro è completato quando viene esposta una funzione is_valid_utf8(string $string): bool che può usare la validità memorizzata mentre la stabilisce per le chiamate successive.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, php
- Ambito
- backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100