From d228b913386cf455e7d2f7f8e27a8ef182b07380 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Sun, 25 May 2025 19:31:07 -0400 Subject: [PATCH] dftest: Convert filter to UTF-8 on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CMakeLists.txt | 1 + dftest.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3db160e0f5..6de10385d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3295,6 +3295,7 @@ if(BUILD_dftest) epan ) set(dftest_FILES + $ dftest.c ) set_executable_resources(dftest "Dftest") diff --git a/dftest.c b/dftest.c index 480d910536..8b69c1f50c 100644 --- a/dftest.c +++ b/dftest.c @@ -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 */