This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ Locale ?? correction


Yes, absolutely right. That's what I thought as well.
Now, who should look at this problem, MinGW64 or Gnu, who should I contact to report this bug?


On 03-May-2017 11:36 AM, Jonathan Wakely wrote:
On 3 May 2017 at 15:00, Papa wrote:
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
Not necessarily. Assuming the content of str is "", it suggests a
problem with the MinGW setlocale function, maybe it can't handle const
char* values that are not allocated in static storage.

--
ArbolOne.ca
Using FireFox and Thunderbird.
ArbolOne is composed of a group of students and volunteers
dedicated to providing free services to charitable organizations.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]