You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using getIPV4Address on Android with the device set to use a language that uses different characters than 0-9 to represent digits causes the returned string to also use those characters. Most notably are some Arabic languages that uses Arabian numerals.
For example, 10.0.2.16 is returned as ١٠.٠.٢.١٦.
This only seems to affect Android. The toString used likely is locale-aware.
While it can be good to use locale-specific representation if the IP is displayed to the user, this seems generally bad as it's inconsistent with iOS and causes issues with other systems, for example when we pass the IP along to our backend.
This probably affect other functions than getIPV4Address as well however that is the function where I stumbled upon the issue.
EDIT: did some digging and it seems to come from the use of String.format which doesn't specify the locale.
The text was updated successfully, but these errors were encountered:
Using
getIPV4Address
on Android with the device set to use a language that uses different characters than 0-9 to represent digits causes the returned string to also use those characters. Most notably are some Arabic languages that uses Arabian numerals.For example,
10.0.2.16
is returned as١٠.٠.٢.١٦
.This only seems to affect Android. The
toString
used likely is locale-aware.While it can be good to use locale-specific representation if the IP is displayed to the user, this seems generally bad as it's inconsistent with iOS and causes issues with other systems, for example when we pass the IP along to our backend.
This probably affect other functions than
getIPV4Address
as well however that is the function where I stumbled upon the issue.EDIT: did some digging and it seems to come from the use of
String.format
which doesn't specify the locale.The text was updated successfully, but these errors were encountered: