kicad-library-utils icon indicating copy to clipboard operation
kicad-library-utils copied to clipboard

Escaped characters in strings not parsed properly

Open Ratfink opened this issue 6 years ago • 0 comments

https://github.com/KiCad/kicad-footprints/pull/388 led me to the discovery that the S-expression parsing code doesn't correctly handle escaped characters in strings. Most significantly, escaped quote marks (\") shouldn't end the string being parsed, but currently they do. This alone can be fixed with a small change to the term_regex expression, specifically the <sq> group.

It would be nice to properly decode any escape sequences rather than reading them literally. I know that \n can also occur in KiCad's S-expressions, representing a newline. The documentation for the file formats isn't especially thorough, so there may be others as well.

Ratfink avatar Mar 13 '18 18:03 Ratfink