Overzealous string unescaping makes some words impossible to format
Description
In certain places, e.g. for net labels, we UnescapeString
even when the string is not stored in escaped state, because of unknown edge cases where we accidentally get an escaped string unexpectedly.
The practical side-effect of this is that the escape sequences cannot be trivially passed through other formatting blocks.
For example: You cannot make a net label called ~{space}
(hoping to get "space" with an overbar) as it is converted to a whitespace character.
The list of strings impacted includes dblquote, quote, lt, gt, backslash, slash, bar, colon, space, dollar, tab, return, brace
User report: https://forum.kicad.info/t/inverted-signals/31845
Steps to reproduce
- Try to create a net label containing one of the escape sequence words inside a formatting block
KiCad Version
Application: KiCad (64-bit)
Version: (5.99.0-13123-g97e9348ee1), release build
Libraries:
wxWidgets 3.1.5
libcurl/7.78.0-DEV Schannel zlib/1.2.11
Platform: Windows 10 (build 19043), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Nov 7 2021 01:01:01
wxWidgets: 3.1.5 (wchar_t,wx containers)
Boost: 1.76.0
OCC: 7.5.0
Curl: 7.78.0-DEV
ngspice: 35
Compiler: Visual C++ 1929 without C++ ABI
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON
Edited by Jon Evans