File: fix-bytestring-decoding-for-proper-display.patch

package info (click to toggle)
avahi 0.8-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,700 kB
  • sloc: ansic: 40,980; sh: 6,061; xml: 4,594; cs: 2,185; makefile: 1,742; python: 441; cpp: 224; sed: 16
file content (29 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: =?utf-8?q?=C3=89ric_Araujo?= <merwok@netwok.org>
Date: Sat, 29 Feb 2020 19:14:04 -0500
Subject: fix bytestring decoding for proper display

Origin: https://github.com/avahi/avahi/commit/a94f72081dd1d546a1d95d860311a1242315bb28
---
 avahi-python/avahi-discover/avahi-discover.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/avahi-python/avahi-discover/avahi-discover.py b/avahi-python/avahi-discover/avahi-discover.py
index 0db705d..4a2b575 100755
--- a/avahi-python/avahi-discover/avahi-discover.py
+++ b/avahi-python/avahi-discover/avahi-discover.py
@@ -238,12 +238,15 @@ class Main_window:
                 txts+="<b>" + _("TXT") + " <i>%s</i></b> = %s\n" % (k,v)
         else:
             txts = "<b>" + _("TXT Data:") + "</b> <i>" + _("empty") + "</i>"
+        
+        txts = txts.decode("utf-8")
 
         infos = "<b>" + _("Service Type:") + "</b> %s\n"
         infos += "<b>" + _("Service Name:") + "</b> %s\n"
         infos += "<b>" + _("Domain Name:") + "</b> %s\n"
         infos += "<b>" + _("Interface:") + "</b> %s %s\n"
         infos += "<b>" + _("Address:") + "</b> %s/%s:%i\n%s"
+        infos = infos.decode("utf-8")
         infos = infos % (stype, name, domain, self.siocgifname(interface), self.protoname(protocol), host, address, port, txts.strip())
         self.info_label.set_markup(infos)