View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012075CMakeCMakepublic2011-04-13 04:362015-06-01 08:38
Reporterzouguangxian 
Assigned ToClinton Stimpson 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSWindowsOS Version
Product Version 
Target VersionFixed in VersionCMake 3.2 
Summary0012075: generated .vcproj with wrong encoding
Descriptionfor example, in Source\cmGlobalVisualStudio7Generator.cxx:
line 636
//----------------------------------------------------------------------------
std::string
cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget* target)
{
  std::string pname = target->GetName();
  pname += "_UTILITY";
  std::string fname = target->GetMakefile()->GetStartOutputDirectory();
  fname += "/";
  fname += pname;
  fname += ".vcproj";
  cmGeneratedFileStream fout(fname.c_str());
  fout.SetCopyIfDifferent(true);
  this->CreateGUID(pname.c_str());
  std::string guid = this->GetGUID(pname.c_str());

  fout <<
    "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"

the encoding always be "Windows-1252", but if the path include chinese characteres, the generated .vcproj can't be open correctly in Visual Studio.

Additional Informationthe solution is:
1. determine the codepage
2. set the correct encoding.

like the following:

  std::string guid = this->GetGUID(pname.c_str());

  std::string encoding = "Windows-1252";
  switch(_getmbcp())
  {
  case 936:
      encoding = "gb2312";
      break;
  default:
      break;
  }
  fout <<
    "<?xml version=\"1.0\" encoding = \"" << encoding << "\"?>\n"
TagsNo tags attached.
Attached Files

 Relationships
related to 0010180closedClinton Stimpson CMake won't generate Visual Studio projects with working paths that have Unicode charactors 
related to 0012074closedClinton Stimpson "Could not copy from" On Windows 7 (Simplified Chinese) 

  Notes
(0028705)
zouguangxian (reporter)
2012-02-23 21:26

It is duplication of 0005097, 0010180.
(0028711)
Brad King (manager)
2012-02-24 08:42

The encoding of generated project files will also have to be honored in the rest of the generator to actually write out a byte stream of characters using that encoding. See 0012074:0028710.
(0037717)
Clinton Stimpson (developer)
2015-01-16 10:12

Fixed by switching to utf-8 internally.
http://www.cmake.org/gitweb?p=cmake.git;a=commit;h=cdc29c3 [^]
(0038843)
Robert Maynard (manager)
2015-06-01 08:38

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-04-13 04:36 zouguangxian New Issue
2012-02-23 21:26 zouguangxian Note Added: 0028705
2012-02-24 08:29 Brad King Relationship added related to 0010180
2012-02-24 08:30 Brad King Relationship added related to 0012074
2012-02-24 08:42 Brad King Note Added: 0028711
2012-02-24 08:42 Brad King Status new => backlog
2015-01-15 23:41 Clinton Stimpson Assigned To => Clinton Stimpson
2015-01-15 23:41 Clinton Stimpson Status backlog => assigned
2015-01-16 10:12 Clinton Stimpson Note Added: 0037717
2015-01-16 10:12 Clinton Stimpson Status assigned => resolved
2015-01-16 10:12 Clinton Stimpson Fixed in Version => CMake 3.2
2015-01-16 10:12 Clinton Stimpson Resolution open => fixed
2015-06-01 08:38 Robert Maynard Note Added: 0038843
2015-06-01 08:38 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team