declare(encoding=...) ignored because Zend multibyte feature is turned off by settings for ASCII or UTF-8
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
Hello :),
Assume you mix files in distinct encodings in various projects.
If some are in ISO-8859-1 or ISO-8859-15 for example,
and others are in UTF-8.
You can have the habit to always use:
declare(encoding='ISO-8859-1')
// or
declare(encoding='ISO-8859-15')
// or
declare(encoding='UTF-8')
// or
declare(encoding='ASCII')
However, if zend.multibyte=0 and you use files with:
declare(encoding='UTF-8')
// or
declare(encoding='ASCII')
you will get
PHP Warning: declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in
which makes you want to remove them.
And if zend.multibyte=1 and you use files with all declare(encoding=...)
you will get no warning.
I would prefer that PHP states clearly what is preferred when the files can be used separately,
and hence some of these files without Zend multibyte:
- If the prefered solution is to always have the declare(encoding=...) directive,
then the warning
should be suppressed for encodings that do not require multibyte.PHP Warning: declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in - If the prefered solution is to never have the declare(encoding=...) directive for encodings that don't need it,
then the warning should be distinct:
and appear whatever the value of Zend multibyte configuration.PHP Warning: declare(encoding='UTF-8') is useless, remove it.
Thanks, best regards,
Laurent Lyaudet
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ソースファイルもテストも指定されていません。記載されている declare(encoding=...) の値を使用し、zend.multibyte を 0 と 1 に設定して警告を再現し、その後、意図された警告の動作を特定します。合意された動作が実装され、回帰チェックでカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100