Repository navigation
修复默认Locale为土耳其语时忽略大小写的Map及Month/Week/ColorUtil名称解析失效的问题 - #4348
Merged
looly merged 1 commit intoOct 28, 2026
Merged
Conversation
土耳其语Locale下 "I".toLowerCase() 为无点的 "ı","i".toUpperCase() 为带点的 "İ",
导致 CaseInsensitiveMap、Dict(true) 中 "ID" 与 "id" 不再视为同一个键,
Month.of("april")、Week.of("friday") 抛出 IllegalArgumentException,
ColorUtil.getColor("white") 返回 null。改为使用 Locale.ROOT 转换大小写。
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
说明
修改描述(包括说明bug修复或者添加新特性)
[bug修复] JVM 默认 Locale 为土耳其语(tr)时,
"I".toLowerCase()是无点的ı,"i".toUpperCase()是带点的İ,导致以下忽略大小写的逻辑失效:CaseInsensitiveMap/new Dict(true):put("ID", v)后get("id")返回nullMonth.of("april")、Week.of("friday"):抛出IllegalArgumentException: No enum constant ...APRİLColorUtil.getColor("white")返回null(pink、light_gray同理)改为用
Locale.ROOT转换大小写。在CaseInsensitiveMapTest、DictTest、MonthTest、WeekTest中补充了用例,并新增ColorUtilTest,这些用例在修改前均失败。提交前自测
JDK 8(Temurin 1.8.0_504)下
mvn -pl hutool-core test新增用例全部通过;其余失败用例(时区 +08:00 假设、CSV 换行)在修改前的 v5-dev 上同样失败,与本次修改无关。I used Claude Code to write this change.