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

[Xen-changelog] [xen-unstable] [ACM] Support for initial unicode handling of strings in policies.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1183729431 -3600
# Node ID d49e6a814d9a4cc8b136b599b77557920abd7921
# Parent  05331a29f3cb1617746dbf0fbea1089a79111bac
[ACM] Support for initial unicode handling of strings in policies.
Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>
---
 tools/security/xensec_ezpolicy |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff -r 05331a29f3cb -r d49e6a814d9a tools/security/xensec_ezpolicy
--- a/tools/security/xensec_ezpolicy    Fri Jul 06 14:42:55 2007 +0100
+++ b/tools/security/xensec_ezpolicy    Fri Jul 06 14:43:51 2007 +0100
@@ -1102,8 +1102,10 @@ def org2dict():
     for i in iterchildren(app.win.orgs.GetRootItem()):
         d = []
         for j in iterchildren(i):
-            d.append(str(app.win.orgspanel.orgs.GetItemText(j)))
-        o.append([str(app.win.orgspanel.orgs.GetItemText(i)) , d])
+            d.append(
+                  str(app.win.orgspanel.orgs.GetItemText(j).encode("utf-8")))
+        o.append([str(app.win.orgspanel.orgs.GetItemText(i).encode("utf-8")),
+                 d])
     dic['orgs'] = o
     c=[]
     for i in app.win.conspanel.conflictsets:
@@ -1175,12 +1177,14 @@ def printPolicy(fd, types, cons):
                 continue
             #name is optional but must be set
             if i[0]:
-                rer_name = str(i[0])
+                rer_name = i[0]
             else:
-                rer_name = str("RER")
-            fd.write("""            <Conflict name=\"%s\">\n""" % rer_name)
+                rer_name = "RER"
+            fd.write("""            <Conflict name=\"""" +
+                     rer_name.encode("utf-8") + """\">\n""")
             for j in i[1]:
-                fd.write("""                <Type>%s</Type>\n""" % str(j))
+                typ = j.encode("utf-8")
+                fd.write("""                <Type>%s</Type>\n""" % typ)
             fd.write("""            </Conflict>\n""")
         fd.write("""       </ConflictSets>\n""")
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.