Encoding: Add setlocale() to applications.
See also bug #14934 where chinese characters could not be used with cpack.
This commit is contained in:
parent
c4a26b70cb
commit
730e386291
|
@ -26,6 +26,7 @@
|
||||||
#include <cmsys/CommandLineArguments.hxx>
|
#include <cmsys/CommandLineArguments.hxx>
|
||||||
#include <cmsys/SystemTools.hxx>
|
#include <cmsys/SystemTools.hxx>
|
||||||
#include <cmsys/Encoding.hxx>
|
#include <cmsys/Encoding.hxx>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static const char * cmDocumentationName[][2] =
|
static const char * cmDocumentationName[][2] =
|
||||||
|
@ -100,6 +101,7 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
|
||||||
// this is CPack.
|
// this is CPack.
|
||||||
int main (int argc, char const* const* argv)
|
int main (int argc, char const* const* argv)
|
||||||
{
|
{
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
cmsys::Encoding::CommandLineArguments args =
|
cmsys::Encoding::CommandLineArguments args =
|
||||||
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
|
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
|
||||||
argc = args.argc();
|
argc = args.argc();
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
#include "cmCursesMainForm.h"
|
#include "cmCursesMainForm.h"
|
||||||
#include "cmCursesStandardIncludes.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)
|
int main(int argc, char const* const* argv)
|
||||||
{
|
{
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
cmsys::Encoding::CommandLineArguments encoding_args =
|
cmsys::Encoding::CommandLineArguments encoding_args =
|
||||||
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
|
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
|
||||||
argc = encoding_args.argc();
|
argc = encoding_args.argc();
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
#include <cmsys/Encoding.hxx>
|
#include <cmsys/Encoding.hxx>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
#ifdef CMAKE_BUILD_WITH_CMAKE
|
#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)
|
int main(int ac, char const* const* av)
|
||||||
{
|
{
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
cmsys::Encoding::CommandLineArguments args =
|
cmsys::Encoding::CommandLineArguments args =
|
||||||
cmsys::Encoding::CommandLineArguments::Main(ac, av);
|
cmsys::Encoding::CommandLineArguments::Main(ac, av);
|
||||||
ac = args.argc();
|
ac = args.argc();
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "CTest/cmCTestScriptHandler.h"
|
#include "CTest/cmCTestScriptHandler.h"
|
||||||
#include "CTest/cmCTestLaunch.h"
|
#include "CTest/cmCTestLaunch.h"
|
||||||
#include "cmsys/Encoding.hxx"
|
#include "cmsys/Encoding.hxx"
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static const char * cmDocumentationName[][2] =
|
static const char * cmDocumentationName[][2] =
|
||||||
|
@ -114,6 +115,8 @@ static const char * cmDocumentationOptions[][2] =
|
||||||
// this is a test driver program for cmCTest.
|
// this is a test driver program for cmCTest.
|
||||||
int main (int argc, char const* const* argv)
|
int main (int argc, char const* const* argv)
|
||||||
{
|
{
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
cmsys::Encoding::CommandLineArguments encoding_args =
|
cmsys::Encoding::CommandLineArguments encoding_args =
|
||||||
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
|
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
|
||||||
argc = encoding_args.argc();
|
argc = encoding_args.argc();
|
||||||
|
|
Loading…
Reference in New Issue