-
Notifications
You must be signed in to change notification settings - Fork 109
Description
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.