-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Android app fails in locales with Indian-Arabic numerals #4156
Closed
Labels
Comments
DentonGentry
changed the title
Android app fails in locales with eastern Arabic numerals
Android app fails in locales with Indian-Arabic numerals
Mar 13, 2022
Awesome bug! |
"Passing structured data from Java to Go is hard. I know, I'll use strings! What can possibly go wrong with strings?" |
DentonGentry
added
OS-android
L1 Very few
Likelihood
P3 Can't get started
Priority level
T8 Crash
Issue type
and removed
needs-triage
labels
Mar 13, 2022
DentonGentry
added a commit
to tailscale/tailscale-android
that referenced
this issue
Mar 13, 2022
We use strings to pass structured data from the JVM to Go. In a locale using Indian-Arabic numerals: ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ the Java code will format decimal strings using Indian-Arabic glyphs. Go doesn't get a locale set automatically by the Android runtime, so it always parses strings in en-US: `unable to parse "lo ١ ٦٥٥٣٦ true false true false false |": expected integer` Make the Java code send en-US strings. These are purely internal to pass between the two runtimes, they are not shown to the user. Fixes tailscale/tailscale#4156 Signed-off-by: Denton Gentry <dgentry@tailscale.com>
DentonGentry
added a commit
to tailscale/tailscale-android
that referenced
this issue
Mar 13, 2022
We use strings to pass structured data from the JVM to Go. In a locale using Indian-Arabic numerals: ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ the Java code will format decimal strings using Indian-Arabic glyphs. Go doesn't get a locale set automatically by the Android runtime, so it always parses strings in en-US: `unable to parse "lo ١ ٦٥٥٣٦ true false true false false |": expected integer` Make the Java code send en-US strings. These are purely internal to pass between the two runtimes, they are not shown to the user. Fixes tailscale/tailscale#4156 Signed-off-by: Denton Gentry <dgentry@tailscale.com>
DentonGentry
added a commit
to tailscale/tailscale-android
that referenced
this issue
Mar 13, 2022
We use strings to pass structured data from the JVM to Go. In a locale using Indian-Arabic numerals: ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ the Java code will format decimal strings using Indian-Arabic glyphs. Go doesn't get a locale set automatically by the Android runtime, so it always parses strings in a default en-US `unable to parse "lo ١ ٦٥٥٣٦ true false true false false |": expected integer` Make the Java code format using the ROOT locale. These strings are purely internal to pass between the two runtimes, they are not shown to the user. Fixes tailscale/tailscale#4156 Signed-off-by: Denton Gentry <dgentry@tailscale.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
What is the issue?
In the Java code where we assemble the list of interfaces we have:
In a locale using Indian-Arabic numerals: ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹
the Java code will format the string as:
lo ١ ٦٥٥٣٦ true false true false false |
In the Go code which parses this string, we have:
which does not handle these numerals:
unable to parse "lo ١ ٦٥٥٣٦ true false true false false |": expected integer
As these strings are purely internal to pass information between the Java runtime and Go environment, they will never be visible to the user. I think the best fix is to set a specific locale in the Java code to format the string.
Steps to reproduce
No response
Are there any recent changes that introduced the issue?
No response
OS
Android
OS version
Android 10
Tailscale version
1.22
Bug report
No response
The text was updated successfully, but these errors were encountered: