Skip to content

🐛 Use locale-independent case conversion for stdlib files, SVG attributes and keywords - #2980

Merged
arnaudroques merged 1 commit into
plantuml:masterfrom
b84330808:fix/turkish-locale-case
Oct 31, 2026
Merged

arnaudroques merged 1 commit into
plantuml:masterfrom
b84330808:fix/turkish-locale-case

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

When the JVM default locale is Turkish (-Duser.language=tr -Duser.country=TR, or a Turkish OS), toLowerCase() turns I into a dotless ı and toUpperCase() turns i into İ. Four places use the default locale for names that are not user text:

  • SpmChannel.getFileName() produces ınfo.spm / ımage.spm, so every !include <...> from the standard library fails: java.io.UncheckedIOException: java.io.FileNotFoundException: stdlib\c4\ınfo.spm
  • UGroupType.getSvgKeyAttributeName(): SVG output gets data-source-lıne, data-qualıfıed-name, data-entıty-uıd and a <tıtle> element
  • ColorType.getType(): class Foo #line:red fails with No enum constant ...ColorType.LİNE
  • GanttTaskTableColumn: hide column duration is silently ignored

The change uses the existing StringUtils.goLowerCase() / goUpperCase() helpers (Locale.ENGLISH). TurkishLocaleTest runs under @DefaultLocale("tr-TR") and covers all four; it fails on master and passes with the change.

Other toLowerCase()/toUpperCase() calls without a locale are left alone here (mostly log text); happy to sweep more if useful.

I used Claude Code to write this change.

…utes and keywords

With a Turkish default locale (tr_TR), String.toLowerCase() maps "I" to a
dotless "ı" and toUpperCase() maps "i" to a dotted "İ". Four places used the
default locale for machine names:

- SpmChannel.getFileName(): INFO and IMAGE became "ınfo.spm" and
  "ımage.spm", so every !include <...> from the standard library failed
  with FileNotFoundException.
- UGroupType.getSvgKeyAttributeName(): SVG output got attributes such as
  data-source-lıne and data-qualıfıed-name, and a <tıtle> element.
- ColorType.getType(): "#line:red" crashed with
  "No enum constant ColorType.LİNE".
- GanttTaskTableColumn: "hide column duration" was silently ignored.

Use the existing StringUtils.goLowerCase()/goUpperCase() helpers, which
pin Locale.ENGLISH, and add a test that runs under tr-TR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@arnaudroques
arnaudroques merged commit c8b56a8 into plantuml:master Oct 31, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants