-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
TCP port in ZMQ_LAST_ENDPOINT depends on global locale #3385
Comments
Sounds about right, could you please send a PR? |
As far as I can tell MSVC doesn't support the "C" locale: https://stackoverflow.com/a/4497266 I'd rather not have ugly |
I'm afraid it's outside of my area - @sigiesec any idea? |
but if there isn't any, better an ugly ifdef than an ugly bug |
I think it would be preferable to change this to use sprintf, e.g., so that this isn't dependent on the locale at all. |
If I read the docs correctly, |
Solution: use sprintf instead of std::stringstream Fixes zeromq#3385
Solution: use sprintf instead of std::stringstream Fixes zeromq#3385
Issue description
The TCP port formatting in
ZMQ_LAST_ENDPOINT
depends on the locale set bystd::locale::global
. With thousands grouping enabled, the port number contains commas. UDP and other ports are likely affected as well.Environment
Minimal test code / Steps to reproduce the issue
What's the actual result?
EP tcp://127.0.0.1:39,375
What's the expected result?
EP tcp://127.0.0.1:39375
Possible fix
In https://github.com/zeromq/libzmq/blob/master/src/tcp_address.cpp#L134, use
s.imbue(std::locale("C"));
The text was updated successfully, but these errors were encountered: