summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2014-05-30 21:41:48 -0600
committerClinton Stimpson <clinton@elemtech.com>2014-06-03 18:22:25 -0600
commit730e386291cb7aad8f532125216b2ec71d710748 (patch)
treefba5ac405d3746f89980bf54e668147497196ce9
parentc4a26b70cbaa1708b3ad28f2d09976fd7b1c925e (diff)
downloadcmake-730e386291cb7aad8f532125216b2ec71d710748.tar.gz
Encoding: Add setlocale() to applications.
See also bug #14934 where chinese characters could not be used with cpack.
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/CursesDialog/ccmake.cxx3
-rw-r--r--Source/cmakemain.cxx2
-rw-r--r--Source/ctest.cxx3
4 files changed, 10 insertions, 0 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 2aa599131c..ad37c42302 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -26,6 +26,7 @@
#include <cmsys/CommandLineArguments.hxx>
#include <cmsys/SystemTools.hxx>
#include <cmsys/Encoding.hxx>
+#include <locale.h>
//----------------------------------------------------------------------------
static const char * cmDocumentationName[][2] =
@@ -100,6 +101,7 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
// this is CPack.
int main (int argc, char const* const* argv)
{
+ setlocale(LC_ALL, "");
cmsys::Encoding::CommandLineArguments args =
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
argc = args.argc();
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index d70bedb4db..a9d4d98456 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -16,6 +16,7 @@
#include <signal.h>
#include <sys/ioctl.h>
+#include <locale.h>
#include "cmCursesMainForm.h"
#include "cmCursesStandardIncludes.h"
@@ -82,6 +83,8 @@ void CMakeMessageHandler(const char* message, const char* title, bool&,
int main(int argc, char const* const* argv)
{
+ setlocale(LC_ALL, "");
+
cmsys::Encoding::CommandLineArguments encoding_args =
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
argc = encoding_args.argc();
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 77f1e4ec98..9f9f6bbdd2 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -25,6 +25,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include <cmsys/Encoding.hxx>
+#include <locale.h>
#ifdef CMAKE_BUILD_WITH_CMAKE
//----------------------------------------------------------------------------
@@ -162,6 +163,7 @@ static void cmakemainProgressCallback(const char *m, float prog,
int main(int ac, char const* const* av)
{
+ setlocale(LC_ALL, "");
cmsys::Encoding::CommandLineArguments args =
cmsys::Encoding::CommandLineArguments::Main(ac, av);
ac = args.argc();
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 3eb5551950..0848f19c01 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -19,6 +19,7 @@
#include "CTest/cmCTestScriptHandler.h"
#include "CTest/cmCTestLaunch.h"
#include "cmsys/Encoding.hxx"
+#include <locale.h>
//----------------------------------------------------------------------------
static const char * cmDocumentationName[][2] =
@@ -114,6 +115,8 @@ static const char * cmDocumentationOptions[][2] =
// this is a test driver program for cmCTest.
int main (int argc, char const* const* argv)
{
+ setlocale(LC_ALL, "");
+
cmsys::Encoding::CommandLineArguments encoding_args =
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
argc = encoding_args.argc();