From 3d61720298432a99674b991d3bab9ef802fa0924 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Sep 2014 00:36:26 +0000 Subject: [PATCH] Fix restoring locale in wxCmdLineParser::SetArguments(). We need to call setlocale(NULL) to query the current locale, setlocale("") returns the newly set locale and not the original one. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/cmdline.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index a9020f17d1..1362a65773 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -278,7 +278,8 @@ void wxCmdLineParserData::SetArguments(int argc, char **argv) // temporarily change the locale here. The only drawback is that changing // the locale is thread-unsafe but precisely because we're called so early // it's hopefully safe to assume that no other threads had been created yet. - char * const locOld = SetAllLocaleFacets(""); + char * const locOld = SetAllLocaleFacets(NULL); + SetAllLocaleFacets(""); wxON_BLOCK_EXIT1( SetAllLocaleFacets, locOld ); for ( int n = 0; n < argc; n++ )