From 80c91b2d0ecb6da3aa7a1349a1190b982c2245af Mon Sep 17 00:00:00 2001 From: Andras Schaffer Date: Sun, 15 Oct 2023 14:30:19 +0200 Subject: [PATCH] DFLog: Fix messages show as System.byte[] Commit #bb7d061 (BinaryLog: fix raw data extraction aka FILE) broke messages display, it fixes it and keeps changes in the commit mentioned above. --- ExtLibs/Utilities/DFLog.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ExtLibs/Utilities/DFLog.cs b/ExtLibs/Utilities/DFLog.cs index 72a2758e15..221b590dce 100644 --- a/ExtLibs/Utilities/DFLog.cs +++ b/ExtLibs/Utilities/DFLog.cs @@ -88,7 +88,8 @@ public string[] items if (a.IsNumber()) return (((IConvertible)a).ToString(CultureInfo.InvariantCulture)); else - return a?.ToString(); + if (a is System.Byte[]) return (System.Text.Encoding.ASCII.GetString(a as byte[]).Trim('\0')); + else return a?.ToString(); }).ToArray(); } return _items; @@ -751,4 +752,4 @@ public long GetLineNoFromTime(DFLogBuffer logdata, DateTime p1) return 0; } } -} \ No newline at end of file +}