git-afsantos / haros

H(igh) A(ssurance) ROS - Static analysis of ROS application code.
MIT License
190 stars 37 forks source link

use utf-8-sig when reading cmakelists to handle bom #120

Closed tandf closed 1 year ago

tandf commented 1 year ago

Some CMakeLists.txt files have BOM at the beginning, like this one: https://raw.githubusercontent.com/ROBOTIS-GIT/turtlebot3_manipulation/master/turtlebot3_manipulation_gui/CMakeLists.txt

Use "utf-8-sig" when opening the file to handle the BOM.

References: https://www.freecodecamp.org/news/a-quick-tale-about-feff-the-invisible-character-cd25cd4630e7/ https://stackoverflow.com/questions/57152985/what-is-the-difference-between-utf-8-and-utf-8-sig

git-afsantos commented 1 year ago

Good catch! Thanks for the PR :+1: