dftest: Convert filter to UTF-8 on Windows

Have dftest include cli_main so that the filter (a command line
argument) is converted from UTF-16 to UTF-8, because that's what
happens when using filters in Wireshark, TShark, or the other
programs. It also prevents some oddities when trying to output
to the screen the filter.

Ping #20501

Before:

.\run\RelWithDebInfo\dftest.exe 'tcp.payload contains \"é\"'
Filter:
 tcp.payload contains "Instructions:
 0000 READ_TREE        tcp.payload      -> R0
 0001 IF_FALSE_GOTO    3
 0002 ANY_CONTAINS     R0 contains e9:
 0003 RETURN

After:

.\run\RelWithDebInfo\dftest.exe 'tcp.payload contains \"é\"'
Filter:
 tcp.payload contains "é"

Instructions:
 0000 READ_TREE        tcp.payload      -> R0
 0001 IF_FALSE_GOTO    3
 0002 ANY_CONTAINS     R0 contains c3:a9
 0003 RETURN
This commit is contained in:
John Thacker 2025-05-25 19:31:07 -04:00
parent 1a1a6c3b38
commit d228b91338
2 changed files with 2 additions and 0 deletions

View File

@ -3295,6 +3295,7 @@ if(BUILD_dftest)
epan
)
set(dftest_FILES
$<TARGET_OBJECTS:cli_main>
dftest.c
)
set_executable_resources(dftest "Dftest")

View File

@ -44,6 +44,7 @@
#include "wsutil/cmdarg_err.h"
#include "ui/failure_message.h"
#include "wsutil/version_info.h"
#include "cli_main.h"
static int opt_verbose;
static int opt_debug_level; /* currently up to 2 */