tools: fix mixup with bytes.decode() and str.encode()
We want to read a bytes file and decode the contents as utf-8 so we can compare against a utf-8 pattern.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines