Thanks for the comments, however, as long as gcc does not provide a
solid support for std::locale, I would say it is better to use
std::setlocale(...). So, in that regard, I'd like to provide another
piece of information that I consider extremely interesting, since it
appears to be a bug and not a human error, please look at the following code
<snip>
//This code works ??
void jme::Locale::setGlobalLocale(const std::string& str){
std::string tmp;
tmp = std::setlocale(LC_ALL, "");
}
</snip>
<snip>
//This does not code works ??
void jme::Locale::setGlobalLocale(const std::string& str){
std::string tmp;
tmp = std::setlocale(LC_ALL, str.data() );
}
</snip>
This shows that either std::setlocale(...) does not know how to handle
std::string::data()/std::string::c_str() return value or neither
std::string::data() nor std::string::c_str() return the expected value
I am using Win8.1 and COLLECT_GCC=C:\gnu\mingw-w64\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=C:/gnu/mingw-w64/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/6.3.0/lto-wrapper.exe
I wonder if I should change to TDM, but I don't see how it would benefit
to the solution of this problem.
Thanks all for the help.
Target: x86_64-w64-mingw32
On 03-May-2017 3:22 AM, Liu Hao wrote:
On 2017/5/3 15:09, Xi Ruoyao wrote:
So where did you get the code? Libstdc++ in current GCC trunk throw
exception for all locales (even if "") except "C".
See
<https://github.com/lhmouse/MINGW-packages/tree/master/mingw-w64-gcc-git>
for patches and build scripts, most of which are merely forked from
MSYS2.
I'll look at the standard. Maybe upstream libstdc++ need a fix for
"" locale.
See N4618 [locale.cons]/6:
```plaintext
explicit locale(const char* std_name);
6 Remarks: The set of valid string argument values is "C", "", and any
implementation-defined values.
```
--
ArbolOne.ca
Using FireFox and Thunderbird.
ArbolOne is composed of a group of students and volunteers
dedicated to providing free services to charitable organizations.
˙ūg + + : U s i n g b u i l t - i n s p e c s .
A t l i n e : 1 c h a r : 1
+ g + + - v 2 >