From a67ed11be6d29f189ff3b434e2e0378e9d74589b Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Mon, 5 Oct 2009 06:26:46 +0200 Subject: [PATCH] Fixed non-ASCII output. Thanks to Mokawi for the report: http://mvidner.blogspot.com/2009/08/cnetworkmanager-021.html?showComment=1254554339823#c5041769288765573270 Pending problems: The table formatting is not right (counting bytes, not columns). It probably still breaks with non-UTF-8 environments. --- dbusclient/__init__.py | 1 + nm-mock | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dbusclient/__init__.py b/dbusclient/__init__.py index 5d338e0..a795234 100644 --- a/dbusclient/__init__.py +++ b/dbusclient/__init__.py @@ -30,6 +30,7 @@ class DBusMio(dbus.proxies.ProxyObject): API_OPTIONS = { "byte_arrays": True, + "utf8_strings": True, } def __init__(self, conn=None, bus_name=None, object_path=None, introspect=True, follow_name_owner_changes=False, **kwargs): diff --git a/nm-mock b/nm-mock index c1e002b..16c4850 100755 --- a/nm-mock +++ b/nm-mock @@ -1,4 +1,5 @@ #!/usr/bin/python +# -*- coding: utf-8 -*- # TODO: adapt nm lib to connect to session bus too, and try this mock @@ -83,7 +84,8 @@ class ConnectionMock(DBusMock): def GetSettings(self): return { "connection": { - "id": "mockid", + # testing non-ASCII output: str vs unicode + "id": "moje síť", # "my net" "type": "mocktype" }, "section1": { -- 2.11.4.GIT