-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Using the streams provided by <iostream>
can change the locale permanently
Command-line test case
D:\>type test-locale-stl.cpp
#include <iostream>
#include <clocale>
char *
query_locale_name()
{
return std::setlocale(LC_ALL, nullptr);
}
int main()
{
std::setlocale(LC_ALL, "norwegian-bokmal.UTF-8");
std::cout << "locale before: " << query_locale_name() << std::endl;
std::cout << 0.1 << std::endl;
std::cout << "locale after: " << query_locale_name() << std::endl;
}
D:\>cl /EHsc /W4 /WX /std:c++latest .\test-locale-stl.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35217 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
/std:c++latest is provided as a preview of language features from the latest C++
working draft, and we're eager to hear about bugs and suggestions for improvements.
However, note that these features are provided as-is without support, and subject
to changes or removal as the working draft evolves. See
https://go.microsoft.com/fwlink/?linkid=2045807 for details.
test-locale-stl.cpp
Microsoft (R) Incremental Linker Version 14.44.35217.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test-locale-stl.exe
test-locale-stl.obj
D:\>test-locale-stl
locale before: Norwegian Bokmål_Norway.utf8
0.1
locale after: C
Expected behavior
Locale after should be Norwegian Bokmål_Norway.utf8
STL version
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35217 for x64
Additional context
dalle
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working