-
Notifications
You must be signed in to change notification settings - Fork 44
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
onvif-gui uses the system's locale #95
Comments
Hello, Thank you for bringing this up, I was not aware that this was an issue. It's hard to know for sure why this happens, it seems to come up in various situations, perhaps due to some platform dependent causes. Maybe a better way of doing this would be to force the decimal point by using a more specific format
|
That would not really help as the dot is just syntax in the format string. |
You are correct, the format doesn't help. I'm thinking the issue in onvif-gui is that an underlying library is changing the locale and this affect is seen by any part of the application. I am not well versed in internationalization issues, so my initial response was naive. It is a surprisingly complex topic. I think maybe the best approach is to hack the string and say that a float will only have one decimal point (or comma) and force the replacement of any comma with a decimal point.
Not really my favorite approach, but it seems to work, and more complex solutions don't seem to provide any further benefit. There's only one spot in the program where this is used, so at least it is limited. Thank you so much for analyzing this issue and finding the cause, as a lifetime US locale user, these sorts of things seem to always be a surprise to me as my world view is pretty limited. |
Hi,
I've been having an interesting issue while using onvif-gui on my debian. I've been using debian in my native language German and I could not set encoder settings of the camera I am using. The reason is that a comma is used instead of a dot for floats. This usually only happens if you use a locale in your code that defaults to this behavior. An example is (unfortunate for me) the German locale.
so this would result in "10,00000" instead of "10.00000" for 10f.
I can fix this by simply changing to en_US. I do not really get why the locale would be used in the first place tho.
I only had a glimpse at the code and could not see the actual cause for the locale usage.
a look into some message via wireshark:
The text was updated successfully, but these errors were encountered: