Skip to content

Avoid locale-dependent String.format for numbers #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

A248
Copy link

@A248 A248 commented Jun 30, 2025

Arabic numerals look like '١' instead of '1' and are used in some Arabic-speaking countries

String.format is locale-dependent, so it will produce these numbers, depending on the machine locale. This PR removes the use of String.format so that JFFI uses the correct string value for stubLibraryName.

Sample Error

Without this PR, running JFFI using an Arabic locale produces an error like this:

[ERROR] : could not get native definition for type `POINTER`, original error message follows: java.lang.UnsatisfiedLinkError: could not locate stub library in jar file.  Tried [jni/x86_64-Linux/libjffi-١.٢.so, /jni/x86_64-Linux/libjffi-١.٢.so]
[ERROR] 	at com.kenai.jffi.internal.StubLoader.getStubLibraryStream(StubLoader.java:589)
[ERROR] 	at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:444)
[ERROR] 	at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:338)
[ERROR] 	at com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:626)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant