From 673de6fd4cc034b0672a68fe255847c4a7dd321c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20K=C3=BCthe?= Date: Sun, 13 Apr 2025 11:58:08 +0000 Subject: [PATCH] Set UTF-8 encoding for XML reports --- ui/mtr.c | 4 ++++ ui/report.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/mtr.c b/ui/mtr.c index 8141771..4d5a343 100644 --- a/ui/mtr.c +++ b/ui/mtr.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -776,6 +777,9 @@ int main( /* This will check if stdout/stderr writing is successful */ atexit(close_stdout); + /* Set encoding for reports */ + setlocale(LC_CTYPE, "C.UTF-8"); + /* reset the random seed */ init_rand(); diff --git a/ui/report.c b/ui/report.c index 364a9be..4b03c0d 100644 --- a/ui/report.c +++ b/ui/report.c @@ -408,7 +408,7 @@ void xml_close( char name[MAX_FORMAT_STR]; char buf[128]; - printf("\n"); + printf("\n"); printf("LocalHostname, ctl->Hostname); printf(" TOS=\"0x%X\"", ctl->tos); -- 2.47.2