From: Marek Küthe Date: Sun, 13 Apr 2025 11:58:08 +0000 (+0000) Subject: Set UTF-8 encoding for XML reports X-Git-Tag: v0.96~2^2~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=673de6fd4cc034b0672a68fe255847c4a7dd321c;p=thirdparty%2Fmtr.git Set UTF-8 encoding for XML reports --- 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);