Closed yubiuser closed 1 year ago
Deleting is not necessary, the issue happens after adding + the adjacent restart.
We are talking about the line
0.0.0.0 Täst.com
in unescaped form. As TOML supports UTF-8, we can just leave it unescaped (this is what https://github.com/pi-hole/FTL/pull/1727) does, however, this has still sent me down a rabbit hole - more details below if you are interested.
FTL currently escapes the added config line to
"0.0.0.0 T\0xc3\0xa4st.com"
which should work but TOMLC99 doesn't like it. Carefully inspectingtoml.c
we see that the only two escape sequence are either of
"0.0.0.0 T\uC3A4st.com"
"0.0.0.0 T\U0000C3A4st.com"
where the \u
has to be lowercase and the hex string itself C3A4
needs to be uppercase (c3a4
is considered invalid) and 2 bytes or \U
uppercase and 4 bytes (still all uppercase). Every other combination leads to a syntax error and FTL hence discarding your most recent changes in development-v6
.
While checking the toml.c
code, I found two auxiliary functions toml_ucs_to_utf8()
and toml_utf8_to_ucs()
which are neither documented nor used by toml.c
itself, but their names alone made me think: Well, that must be there for a reason and they may be what we need. So I checked out these functions to learn how to use them and took them to do the heavy lifting with escaping. This worked out nicely. The escaped string reads:
"0.0.0.0 T\U0000C3A4st.com"
Steps to reproduce the behavior: