[cmake-developers] [CMake 0015326]: CMake can't read UTF-16 source files

Mantis Bug Tracker mantis at public.kitware.com
Wed Dec 24 12:48:05 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15326 
====================================================================== 
Reported By:                Kwabena W. Agyeman
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15326
Category:                   CMake
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-12-24 12:48 EST
Last Modified:              2014-12-24 12:48 EST
====================================================================== 
Summary:                    CMake can't read UTF-16 source files
Description: 
I'm trying to do dependency parsing in cmake for parallax propeller spin files.
This involves opening up *.spin code files and parsing them using the
file(STRINGS ... REGEX ...) command. Most spin files are saved as ASCII/UTF-8
files and there are no problems parsing these files. However, some spin files
are saved in UTF-16 format which allows the use of special schematic characters
in the files. Using the file(STRINGS ... REGEX ...) command does not work on
UTF-16 files as cmake is unable to parse them.


Steps to Reproduce: 
The below code should find the "DAT" string in the attached file...

file(STRINGS "Quadrature Encoder.spin" OUT REGEX "^[\t ]*[Dd][Aa][Tt].*$")


Additional Information: 
Saving the problem UTF-16 files as UTF-8 files fixes the issue. But, I can't
just convert the source files. There's a lot of legacy spin code I need to
support that uses the UTF-16 format for the special schematic characters.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-12-24 12:48 Kwabena W. AgyemanNew Issue                                    
2014-12-24 12:48 Kwabena W. AgyemanFile Added: Quadrature Encoder.spin          
         
======================================================================



More information about the cmake-developers mailing list