Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Bug #52211 (iconv() returns part of string on error) [ext/iconv/tests/bug52211.phpt

Abierto
#23,874 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
64/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c

Línea de trabajo

Start by running ext/iconv/tests/bug52211.phpt and reading the related iconv extension test and implementation paths. Check how the test selects charsets and how the conversion error is reported; done means the test produces the expected illegal-character notice and false result on supported implementations.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Bug Status: Needs Triage
Description

The following code:

// According to POSIX 2024, the to/from charset names are
// implementation-defined. To keep this test true to its original
// purpose, we retain the charsets used in bug 52211, but only when
// the implementation is known to support them. Otherwise we default
// both to ASCII, which should be supported everywhere (in particular
// on musl) yet still considers the input invalid.
$from_charset = "ASCII";
$to_charset = "ASCII";

if (ICONV_IMPL == "libiconv" || ICONV_IMPL == "glibc") {
    $from_charset = "CP850";
    $to_charset = "ISO-8859-1";
}

$str = "PATHOLOGIES MÉDICO-CHIRUR. ADUL. PL";
$str_iconv = iconv($from_charset, $to_charset, $str );
var_dump($str_iconv);
<?php

Resulted in this output:

Warning: iconv(): Wrong encoding, conversion from "CP850" to "ISO-8859-1" is not allowed in /opt/php/8.6/php-8.6.0beta3/ext/iconv/tests/bug52211.php on line 18
bool(false)

But I expected this output instead:

Notice: iconv(): Detected an illegal character in input string in %s on line %d
bool(false)
PHP Version
PHP 8.6.0beta3 (cli) (built: Sep 24 2026 01:10:42) (NTS DEBUG)
Copyright © The PHP Group and Contributors
Zend Engine v4.6.0-dev, Copyright © Zend by Perforce
    with Zend OPcache v8.6.0beta3, Copyright ©, by Zend by Perforce
Operating System

Fedora Linux 44 (Container Image)

Lenguaje dominante
C
Estrellas
40.4k
Forks
8.2k
Merge medio
2 d 15 h
PR fusionados (30 d)
113

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de php/php-src

Todos los issues de php/php-src

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.