Bug #52211 (iconv() returns part of string on error) [ext/iconv/tests/bug52211.phpt
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 64/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c
- 領域
- backend, testing-qa
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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)
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 113
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
php/php-src のほかの issue
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
Bug Status: Needs Triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Bug Category: Tests Status: Verified
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Bug SAPI: fpm Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NVIDIA/k8s-device-plugin#2061 · コメント 1 件 ·
-
task
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vsanthanam/JBird#429 ·