php / php/doc-ja

PHP 8.1以降、 mb_strwidth() が実態に即していない

Open
#57 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
XML
Stars
93
Forks
86
Avg merge
9h
Merged PRs (30d)
15

Description

refs https://github.com/php/php-src/commit/d8c785b894e1a4ed9793d71cad02330cb0034faa

文字幅に関する仕様はPHP: mb_strwidth - Manualで説明されている通りUnicodeのTR-11 EAST ASIAN WIDTHに準拠していますがeaw_table.hは2011年から更新されておらず、PHP 8.1リリース前のmbstringのオーバーホールによってUnicode 14.0に追従しました。

その際、てきめんさん @youkidearitai が指摘するように、2011年以降に追加されたEAWプロパティがFWの文字に関する計算が変わってしまっています。

PHP: mb_strwidth - Manual に関して、以下の対応が必要になりそうです。

  • 対象文字に関する記述を調整する
  • 変更履歴にPHP 8.1でUnicode 14.0.0準拠になったことを明記する

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Japanese mb_strwidth manual page and review its description of character widths against Unicode 14.0.0. Then check the PHP 8.1 change history documentation; done means updating the affected character description and noting the Unicode 14.0.0 alignment in the changelog.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.