encodings: Fix detection of non-UTF-8 inline encodings
commitb23201c01390e6ed6d631cf232e404691ffe91ec
authorColomban Wendling <ban@herbesfolles.org>
Fri, 8 Dec 2023 20:43:40 +0000 (8 21:43 +0100)
committerColomban Wendling <ban@herbesfolles.org>
Fri, 8 Dec 2023 20:43:40 +0000 (8 21:43 +0100)
tree806aff049f04ce432cc8cda9a4193ff8f6193660
parentae01d302425e53b82a90d87c4445d98441a77414
encodings: Fix detection of non-UTF-8 inline encodings

If there are non-UTF-8 data in the first 512 bytes we failed to detect
the inline encoding using the regex match, because our regexes required
a fully valid UTF-8 buffer.

This kind of defeats the purpose of the feature; so relax the match to
use plain bytes instead.
src/encodings.c
tests/test_encodings.c