When a source file contains an invalid UTF-8 character, YARA-X fails with an error like this:
error: invalid UTF-8
--> test.yar:3:19
|
3 | author = "John Smith � "
| ^ invalid UTF-8 character
|
By using the chardetng and encoding_rs crates, the encoding of the original source file could be automatically detected and then converted to UTF-8, before the source code is passed to the parser.
This automatic encoding conversion would be performed only when the --force-utf-8 option is passed to the CLI.
When a source file contains an invalid UTF-8 character, YARA-X fails with an error like this:
By using the chardetng and encoding_rs crates, the encoding of the original source file could be automatically detected and then converted to UTF-8, before the source code is passed to the parser.
This automatic encoding conversion would be performed only when the
--force-utf-8
option is passed to the CLI.