MantisBT - CMake
View Issue Details
0015476CMakeCPackpublic2015-03-26 05:302015-11-02 09:13
Richard Ulrich 
Nils Gladitz 
normalmajoralways
closedfixed 
CMake 3.2.1 
CMake 3.3 
0015476: WiX packages not created with files that contain special characters.
After upgrading to cmake 3.2.1, WiX packages can no longer be created that contain files with special characters in their name.
Use the attached minimal project, and try to generate a WiX installer.
error LGHT0103 : The system cannot find the file '... <garbled chars>.txt'

If I open files.wxs, instead of the special chars, it displays garbage characters.
No tags attached.
zip wix_utf8.zip (984) 2015-03-26 05:30
https://public.kitware.com/Bug/file/5413/wix_utf8.zip
Issue History
2015-03-26 05:30Richard UlrichNew Issue
2015-03-26 05:30Richard UlrichFile Added: wix_utf8.zip
2015-03-26 05:31Nils GladitzAssigned To => Nils Gladitz
2015-03-26 05:31Nils GladitzStatusnew => assigned
2015-03-26 06:51Nils GladitzNote Added: 0038295
2015-03-26 09:56Richard UlrichNote Added: 0038298
2015-03-26 10:05Nils GladitzNote Added: 0038299
2015-03-27 03:34Nils GladitzNote Added: 0038340
2015-03-27 04:01Nils GladitzNote Added: 0038341
2015-03-27 05:17Richard UlrichNote Added: 0038342
2015-03-27 06:45Nils GladitzNote Added: 0038343
2015-03-27 07:26Nils GladitzNote Added: 0038344
2015-03-30 09:32Nils GladitzNote Added: 0038361
2015-03-30 09:32Nils GladitzStatusassigned => resolved
2015-03-30 09:32Nils GladitzFixed in Version => CMake 3.3
2015-03-30 09:32Nils GladitzResolutionopen => fixed
2015-11-02 09:13Robert MaynardNote Added: 0039754
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038295)
Nils Gladitz   
2015-03-26 06:51   
I haven't been able to reproduce this with 3.2.1 yet.

The package seems to be generated ok and the UTF-8 encoded files.wxs in my case contains e.g:
C:/src/tests/wix_utf8/build/_CPack_Packages/win64/WIX/wix_utf8-0.1.1-win64/äöü.txt (ungarbled).
(0038298)
Richard Ulrich   
2015-03-26 09:56   
I can consistently reproduce the problems on three different machines with:
* Windows 7
* Windows 8
* Windows Server 2012

With the installer downloaded from cmake.org, and if I build cmake myself from github using the v3.2.1 tag.

With VisualStudio 32 and 64bit compiler mode.

Windows Regional Settings are for Switzerland, but that shouldn't affect how filenames are treated.

What else could be different on your machine?
(0038299)
Nils Gladitz   
2015-03-26 10:05   
Sounds identical to what I've got here in every conceivable/relevant way.

I tested on Windows 7 (64-bit) with VS2010 (64-bit) with git tag "v3.2.1" with German (Germany) region and language settings.
(0038340)
Nils Gladitz   
2015-03-27 03:34   
I tried the 3.2.1 build from cmake.org and with that I can reproduce the issue.
Somehow the way that cmake itself is build seems to make a difference.

Which visual studio version were you using?
(0038341)
Nils Gladitz   
2015-03-27 04:01   
There seems to be an underlying issue that goes beyond just the WIX generator.

Given a UTF-8 (with BOM) encoded test.cmake:
file(WRITE öäü)

>cmake-git --version (My local VS2010 build)
cmake version 3.2.1
[...]

>cmake-3.2.1 --version (Official cmake.org build ... I think VS2008)
cmake version 3.2.1
[...]

>cmake-git -P test.cmake
Produces a file named "öäü".

>cmake-3.2.1 -P test.cmake
Produces a file named "öäü".
(0038342)
Richard Ulrich   
2015-03-27 05:17   
For the most part we're using Visual Studio 2013
(0038343)
Nils Gladitz   
2015-03-27 06:45   
Looks like the difference between the builds was the value of the CMAKE_ENCODING_UTF8 cache variable.

My local cmake build had CMAKE_ENCODING_UTF8:BOOL=OFF which I am guessing was the default at some point when it was introduced.

A fresh build defaults to CMAKE_ENCODING_UTF8:BOOL=ON.
(0038344)
Nils Gladitz   
2015-03-27 07:26   
I merged http://www.cmake.org/gitweb?p=cmake.git;a=commit;h=98a3b2e29ece5195e7948681a410bc5fae880a23 [^] for testing.

If CMAKE_ENCODING_UTF8 is set this will skip the codepage -> utf8 conversion in the WIX generator itself.
(0038361)
Nils Gladitz   
2015-03-30 09:32   
The fix has been merged to master.
(0039754)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.