[sysadmin-bin] Decode into UTF-8 directly on glu



commit 5461bc13d6807710330c24d0d2e963ee257f7e88
Author: Andrea Veri <averi redhat com>
Date:   Fri Feb 25 12:50:35 2022 +0100

    Decode into UTF-8 directly on glu

 gnome_ldap_utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnome_ldap_utils.py b/gnome_ldap_utils.py
index 4663ead..1ee8c0c 100755
--- a/gnome_ldap_utils.py
+++ b/gnome_ldap_utils.py
@@ -56,7 +56,7 @@ class Gnome_ldap_utils:
 
             for arg in attrs:
                 try:
-                    results.append(_result[0][1][arg][0])
+                    results.append(_result[0][1][arg][0].decode('UTF-8'))
                 except KeyError:
                     results.append(None)
         else:
@@ -66,7 +66,7 @@ class Gnome_ldap_utils:
             return results
         elif len(result) > 0:
             try:
-                return result[0][1][attr][0]
+                return result[0][1][attr][0].decode('UTF-8')
             except KeyError:
                 return None
         else:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]