Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#23,874 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
64/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
backend, testing-qa

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)

Ngôn ngữ chính
C
Star
40.4k
Fork
8.2k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
113

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của php/php-src

Tất cả issue của php/php-src

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.