Skip to content

GH-1300: Use Locale.ROOT when building C Data Interface format strings - #1301

Merged
kou merged 1 commit into
apache:mainfrom
lawofcycles:gh-1300-format-locale
Sep 22, 2026
Merged

kou merged 1 commit into
apache:mainfrom
lawofcycles:gh-1300-format-locale

Conversation

@lawofcycles

@lawofcycles lawofcycles commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Format.asString built the FixedSizeList (+w:%d), FixedSizeBinary (w:%d) and Decimal (d:%d,%d[,%d]) format strings with String.format and no explicit Locale. java.util.Formatter localises the digits of %d with the default locale, so a JVM running under ar-EG, bn-BD, mr-IN and similar locales exported +w:٨ instead of +w:8, which arrow-rs and other implementations reject.

This passes Locale.ROOT to the four calls and adds FormatTest.testAsStringIgnoresDefaultLocale, which sets the default locale to ar-EG for the duration of the test and asserts the ASCII output.

Closes #1300.

…strings

Format.asString built the FixedSizeList, FixedSizeBinary and Decimal
format strings with String.format and no explicit Locale, so JVMs whose
default locale uses digits outside ASCII exported strings such as "+w:٨"
that other Arrow implementations cannot parse.

Closes apache#1300.
@github-actions

This comment has been minimized.

@lidavidm lidavidm added the bug-fix PRs that fix a big. label Sep 20, 2026
@github-actions github-actions Bot added this to the 20.0.0 milestone Sep 20, 2026

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou
kou merged commit 53a9ccd into apache:main Sep 22, 2026
20 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PRs that fix a big.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C Data] Format.asString emits locale dependent digits in format strings

3 participants