MantisBT - CMake
View Issue Details
0010519CMakeCMakepublic2010-04-08 08:192015-01-05 08:39
Vladislav Vaintroub 
Clinton Stimpson 
normalmajoralways
closedfixed 
 
CMake 3.1CMake 3.1 
0010519: FILE(STRINGS) does not work correctly for UTF8 encoded strings
I have a file which is UTF8 encoded . It contains mostly ASCII, but there is a greek PI literal there as well). I read the file contents with FILE(STRINGS)
The string containing PI is read incorrectly (I only get the contents after PI, not before it).
Attached is a reproducible case. After unzipping bug.zip, run it with
cmake -P bug.cmake
It loads a string from example.sql and prints it to stdout.
Only part of original string is shown.
No tags attached.
zip bug.zip (614) 2010-04-08 08:19
https://public.kitware.com/Bug/file/3012/bug.zip
Issue History
2010-04-08 08:19Vladislav VaintroubNew Issue
2010-04-08 08:19Vladislav VaintroubFile Added: bug.zip
2010-04-08 08:20Vladislav VaintroubNote Added: 0020104
2010-04-08 12:35Bill HoffmanStatusnew => assigned
2010-04-08 12:35Bill HoffmanAssigned To => Brad King
2012-08-13 10:44Brad KingStatusassigned => backlog
2012-08-13 10:44Brad KingNote Added: 0030557
2014-08-04 10:28Clinton StimpsonNote Added: 0036543
2014-08-04 10:56Brad KingAssigned ToBrad King => Clinton Stimpson
2014-08-04 10:56Brad KingStatusbacklog => assigned
2014-08-04 10:56Brad KingNote Edited: 0036543bug_revision_view_page.php?bugnote_id=36543#r1534
2014-08-06 09:24Brad KingNote Added: 0036560
2014-08-06 09:25Brad KingStatusassigned => resolved
2014-08-06 09:25Brad KingResolutionopen => fixed
2014-08-06 09:25Brad KingFixed in Version => CMake 3.1
2014-08-06 09:25Brad KingTarget Version => CMake 3.1
2014-08-06 09:25Brad KingAdditional Information Updatedbug_revision_view_page.php?rev_id=1536#r1536
2015-01-05 08:39Robert MaynardNote Added: 0037609
2015-01-05 08:39Robert MaynardStatusresolved => closed

Notes
(0020104)
Vladislav Vaintroub   
2010-04-08 08:20   
tried it on Windows only, don't know if problem exist anywhere else.
(0030557)
Brad King   
2012-08-13 10:44   
Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0036543)
Clinton Stimpson   
2014-08-04 10:28   
(edited on: 2014-08-04 10:56)
cmFileCommand: Add ENCODING option to file(STRINGS ...)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8157cb2e [^]

Is that enough to resolve this bug, and wait for someone else to request utf-16/utf-32?

(0036560)
Brad King   
2014-08-06 09:24   
Re 0010519:0036543: Revised version of the commit:

 file: Add ENCODING option to file(STRINGS) command
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5b30ec28 [^]

Yes, I think this resolves the issue.
(0037609)
Robert Maynard   
2015-01-05 08:39   
Closing resolved issues that have not been updated in more than 4 months