Skip to content

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

Open
lawofcycles wants to merge 1 commit into
apache:mainfrom
lawofcycles:gh-1300-format-locale
Open

lawofcycles wants to merge 1 commit into
apache:mainfrom
lawofcycles:gh-1300-format-locale

Conversation

@lawofcycles

@lawofcycles lawofcycles commented Sep 19, 2026

Copy link
Copy Markdown

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
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

2 participants