From: Aaron Bentley Date: Thu, 26 Jan 2006 15:10:43 +0000 (-0500) Subject: Enforced that all key/value pairs are unicode X-Git-Tag: 1.0.0~230 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c54498e1b59b2e4371fb76e07a5e81365a940f88;p=be.git Enforced that all key/value pairs are unicode --- 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