Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Preserve Unicode locale data in DateTime::Locale::FromCLDR

未关闭
#1,374 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java, perl, sqlite

调研方向

使用 system Perl 作为基准,重现 t/01.locale.t、t/03.day_period.t、t/04.am_pm.t、t/05.timezone.t、t/06.locale_numbering_system.t 和 t/10.number_system_digits.t 中的失败。跟踪 Locale::Unicode::Data/SQLite/DBI 路径和 PerlOnJava 标量表示,找出 UTF-8 字节变成 Latin-1 字符的位置。当一个针对非 ASCII 字符的聚焦回归测试在两个后端上都通过,并且 DateTime-Locale-FromCLDR v0.8.7 通过全部 219 个测试时,即视为完成。

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

描述

area:backend area:cpan-port area:unicode bug

Summary

PerlOnJava corrupts non-ASCII locale data returned by DateTime::Locale::FromCLDR v0.8.7. UTF-8 values are exposed as byte sequences interpreted as Latin-1, producing mojibake. ASCII locale data remains correct.

CPAN impact

  • Distribution: DateTime-Locale-FromCLDR v0.8.7
  • CPAN run: 20260913-205737-64746
  • PerlOnJava result: 25 of 219 subtests failed in 6 of 15 test programs
  • Affected tests: t/01.locale.t, t/03.day_period.t, t/04.am_pm.t, t/05.timezone.t, t/06.locale_numbering_system.t, and t/10.number_system_digits.t

The unaffected tests include t/07.ltr.t, t/08.dst.t, t/09.fatal.t, and the POD tests.

Observed failures

Representative values are returned as UTF-8 bytes decoded as Latin-1. For example:

got:      バチカン
expected: バチカン

Other observed mismatches include:

got:      午前
expected: 午前

got:      a. m.
expected: a. m.

got:      Ù 
expected: ٠

Failures affect Japanese, Korean, Arabic, French, and other locale data, including AM/PM names, timezone names and formats, numbering-system digits, and locale display strings.

System Perl oracle

The same distribution and dependency versions pass completely under system Perl in the archived run:

t/01.locale.t ................... ok
t/03.day_period.t ............... ok
t/04.am_pm.t .................... ok
t/05.timezone.t ................. ok
t/06.locale_numbering_system.t .. ok
t/10.number_system_digits.t ..... ok
All tests successful.
Files=15, Tests=219
Result: PASS

The distribution is pure Perl. Its Locale::Unicode::Data dependency supplies CLDR data through a bundled SQLite database; no external locale service or native prerequisite is involved in the failing path.

Expected behavior

DateTime::Locale::FromCLDR should return Perl character strings preserving the original Unicode code points and should produce the same locale names, patterns, and digit strings as system Perl.

Investigation requested

Trace the Unicode conversion boundary in the Locale::Unicode::Data/SQLite/DBI path and the PerlOnJava scalar representation. Determine where UTF-8 bytes become Latin-1 characters, then add a small system-Perl-validated regression test covering a non-ASCII CLDR value such as the Japanese AM/PM string or Arabic digits.

The issue may share infrastructure with broader Unicode byte/character problems tracked in issue #1275, but this is a distinct, reproducible CLDR data-path failure.

Acceptance criteria

  • Non-ASCII CLDR values retain correct code points and UTF-8 semantics.
  • The focused regression passes on JVM and interpreter backends.
  • DateTime-Locale-FromCLDR v0.8.7 passes all 219 tests on both backends.
主要语言
Perl
星标
64
派生
6
平均合并
5 小时 38 分钟
30 天内合并 PR
170

贡献指南

打开贡献指南

从这里开始

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

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

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