Finer-grained return values from bind_textdomain_codeset()
@devnexen ya está trabajando en esto.
Desde el 15/12/2024.
- Lenguaje dominante
- C
- Estrellas
- 40.4k
- Forks
- 8.1k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 96
Descripción
Description
As mentioned in https://github.com/php/doc-en/issues/4311, the bind_textdomain_codeset() function returns false in some "success" cases because it is only looking at the NULL returned from the C function. But that NULL is not necessarily an error, it just means that the codeset has not changed from the default. In particular, you'll get a NULL from glibc if you query a codeset that hasn't been set yet, and you'll always get NULL on musl.
According to https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/bind_textdomain_codeset.html, the value of errno may be a better indicator:
If bind_textdomain_codeset() fails, a null pointer shall be returned and errno shall be set to indicate the error.
Edit: as of musl-1.2.6, a NULL is returned only when the codeset is not "UTF-8" (https://git.musl-libc.org/cgit/musl/commit/src/locale/bind_textdomain_codeset.c?id=cabbd8697d39c09ca37fb3d63b86b42526b81fda)
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Evaluación
Este issue todavía no se ha evaluado.