From 3ec753d0c800680f01350d5a8478b872401a88e9 Mon Sep 17 00:00:00 2001 From: Anders Blomdell <anders.blomdell@control.lth.se> Date: Tue, 25 Aug 2015 12:09:56 +0200 Subject: [PATCH] Changed encoding to utf-8 --- Makefile | 2 +- src/hostinfo.py | 6 +++--- src/hostinfo/mio.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f210093..75df8ef 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,6 @@ TARGETS: hostinfo all: $(TARGETS) -hostinfo: src/hostinfo.py $(wildcard src/hostinfo/*.py) Makefile +hostinfo: src/hostinfo.py $(sort $(wildcard src/hostinfo/*.py)) Makefile (cd src ; apa -o ../$@ $(filter %.py, $(^:src/%=%))) diff --git a/src/hostinfo.py b/src/hostinfo.py index 862f10a..e0d2553 100755 --- a/src/hostinfo.py +++ b/src/hostinfo.py @@ -325,7 +325,7 @@ if __name__ == '__main__': if options.mio: mio = hostinfo.mio.generate(tree) - print mio.encode("iso8859-1") + print mio.encode("utf-8") if options.named: for (f, c) in hostinfo.named.generate(tree, options): @@ -371,7 +371,7 @@ if __name__ == '__main__': f = open(name) conf = f.read() f.close() - write = conf != file[name].encode("iso8859-1") + write = conf != file[name].encode("utf-8") except IOError, e: write = True @@ -379,7 +379,7 @@ if __name__ == '__main__': print name result = 0 f = open(name, "w") - f.write(file[name].encode("iso8859-1")) + f.write(file[name].encode("utf-8")) f.close() for name in symlink.keys(): diff --git a/src/hostinfo/mio.py b/src/hostinfo/mio.py index c2670a2..9fcfe43 100755 --- a/src/hostinfo/mio.py +++ b/src/hostinfo/mio.py @@ -2,7 +2,7 @@ import copy import hostinfo def generate(tree): - result = "<?xml version='1.0' encoding='iso8859-1'?>\n\n" + result = "<?xml version='1.0' encoding='utf-8'?>\n\n" mio = hostinfo.parser.Node("mio") for m in tree._mio_: mio = copy.deepcopy(m) -- GitLab