From c54498e1b59b2e4371fb76e07a5e81365a940f88 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Thu, 26 Jan 2006 10:10:43 -0500 Subject: [PATCH] Enforced that all key/value pairs are unicode --- libbe/mapfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libbe/mapfile.py b/libbe/mapfile.py index 3760938..bbbd860 100644 --- a/libbe/mapfile.py +++ b/libbe/mapfile.py @@ -67,7 +67,7 @@ def generate(f, map, context=3): for key in keys: for i in range(context): f.write("\n") - f.write("%s=%s\n" % (key, map[key])) + f.write("%s=%s\n" % (key.encode("utf-8"), map[key].encode("utf-8"))) for i in range(context): f.write("\n") @@ -94,7 +94,7 @@ def parse(f): line = line.rstrip('\n') if len(line) == 0: continue - name,value = line.split('=', 1) + name,value = [f.decode('utf-8') for f in line.split('=', 1)] assert not result.has_key('name') result[name] = value return result -- 2.26.2