php / php/php-src

MB_CASE_TITLE treats entities as words (in contrast to uc_words)

未关闭
#18,236 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Extension: mbstring Status: Needs Triage
主要语言
C
星标
40.4k
派生
8.1k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Description

The following code:

<?php
$txt = 'acme &amp; co';

echo mb_convert_case($txt, MB_CASE_TITLE, 'UTF-8'), PHP_EOL;

Resulted in this output:

Acme &Amp; Co

But I expected this output instead:

Acme &amp; Co

Using uc_words produces the expected result:

<?php
$txt = 'acme &amp; co';

echo ucwords($txt), PHP_EOL;

results in

Acme &amp; Co
PHP Version

PHP 8.4.5, PHP 8.2.26

Operating System

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 mb_convert_case 入口开始,使用提供的 acme & co 示例重现报告的 PHP 8.4.5 和 8.2.26 行为。当标题大小写转换保留实体为 &,同时仍生成 Acme 和 Co,并为报告的输入提供回归覆盖时,工作即完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
internationalization
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
50/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。